mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-01-26 00:18:26 +00:00
Fix bug in dropdown
The menu for a multi-dropdown should only show entries that are not already selected (there is no use case to select the same item more than once).
This commit is contained in:
parent
152ad7373c
commit
d41ddd9729
@ -12,6 +12,9 @@ module Comp.Dropdown exposing
|
||||
, view
|
||||
)
|
||||
|
||||
{-| This needs to be rewritten from scratch!
|
||||
-}
|
||||
|
||||
import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
@ -41,7 +44,8 @@ makeItem model val =
|
||||
{ value = val
|
||||
, option = model.makeOption val
|
||||
, visible = True
|
||||
, selected = False
|
||||
, selected =
|
||||
List.any (\i -> i.value == val) model.selected
|
||||
, active = False
|
||||
}
|
||||
|
||||
|
@ -276,6 +276,7 @@ saveTags flags model =
|
||||
let
|
||||
tags =
|
||||
Comp.Dropdown.getSelected model.tagModel
|
||||
|> Util.List.distinct
|
||||
|> List.map (\t -> IdName t.id t.name)
|
||||
|> ReferenceList
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user