Skip to content

Commit

Permalink
Add MenuToggle action for all variants
Browse files Browse the repository at this point in the history
  • Loading branch information
Jaime Terreu committed Oct 13, 2024
1 parent db0585f commit ee800ef
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Select.elm
Original file line number Diff line number Diff line change
Expand Up @@ -1951,13 +1951,13 @@ update msg ((State state_) as wrappedState) =
resolveAction =
case state_.inputValue of
Just "" ->
Nothing
Just (MenuToggle MenuClose)

Just _ ->
Just (InputChange "")

_ ->
Nothing
Just (MenuToggle MenuClose)

( _, State stateWithClosedMenu, cmdWithClosedMenu ) =
update CloseMenu (State state_)
Expand Down Expand Up @@ -2068,8 +2068,15 @@ update msg ((State state_) as wrappedState) =

_ ->
internalFocus idString OnInputFocused

toggleAction =
if state_.menuOpen then
MenuToggle MenuOpen

else
MenuToggle MenuClose
in
( Nothing
( Just toggleAction
, State { updatedState | controlUiFocused = Just Internal.ControlInput }
, focusCmd
)
Expand Down

0 comments on commit ee800ef

Please sign in to comment.