mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-06 15:15:58 +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
|
, view
|
||||||
)
|
)
|
||||||
|
|
||||||
|
{-| This needs to be rewritten from scratch!
|
||||||
|
-}
|
||||||
|
|
||||||
import Data.UiSettings exposing (UiSettings)
|
import Data.UiSettings exposing (UiSettings)
|
||||||
import Html exposing (..)
|
import Html exposing (..)
|
||||||
import Html.Attributes exposing (..)
|
import Html.Attributes exposing (..)
|
||||||
@ -41,7 +44,8 @@ makeItem model val =
|
|||||||
{ value = val
|
{ value = val
|
||||||
, option = model.makeOption val
|
, option = model.makeOption val
|
||||||
, visible = True
|
, visible = True
|
||||||
, selected = False
|
, selected =
|
||||||
|
List.any (\i -> i.value == val) model.selected
|
||||||
, active = False
|
, active = False
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -276,6 +276,7 @@ saveTags flags model =
|
|||||||
let
|
let
|
||||||
tags =
|
tags =
|
||||||
Comp.Dropdown.getSelected model.tagModel
|
Comp.Dropdown.getSelected model.tagModel
|
||||||
|
|> Util.List.distinct
|
||||||
|> List.map (\t -> IdName t.id t.name)
|
|> List.map (\t -> IdName t.id t.name)
|
||||||
|> ReferenceList
|
|> ReferenceList
|
||||||
in
|
in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user