Merge pull request #266 from eikek/quicksearch-fix

Move field contents when switching search mode in search bar
This commit is contained in:
mergify[bot] 2020-09-16 20:51:51 +00:00 committed by GitHub
commit 3083af74e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -208,15 +208,37 @@ update mId key flags settings msg model =
let let
( sm, mv ) = ( sm, mv ) =
Comp.FixedDropdown.update lm model.searchTypeDropdown Comp.FixedDropdown.update lm model.searchTypeDropdown
in
withSub m0 =
( { model { model
| searchTypeDropdown = sm | searchTypeDropdown = sm
, searchTypeForm = Maybe.withDefault model.searchTypeForm mv , searchTypeForm = Maybe.withDefault model.searchTypeForm mv
} }
, Cmd.none
next =
case mv of
Just BasicSearch ->
Just
( { m0 | contentOnlySearch = Nothing }
, Maybe.withDefault "" model.contentOnlySearch
) )
Just ContentOnlySearch ->
Just
( { m0 | contentOnlySearch = model.searchMenuModel.allNameModel }
, ""
)
_ ->
Nothing
in
case next of
Just ( m_, nstr ) ->
update mId key flags settings (SearchMenuMsg (Comp.SearchMenu.SetAllName nstr)) m_
Nothing ->
withSub ( m0, Cmd.none )
KeyUpMsg (Just Enter) -> KeyUpMsg (Just Enter) ->
update mId key flags settings DoSearch model update mId key flags settings DoSearch model