Commit bbe95577 authored by Arthur Rump's avatar Arthur Rump

Add remove filter link, closes #1

parent 6176048e
Pipeline #41485498 passed with stages
in 2 minutes and 41 seconds
......@@ -172,7 +172,7 @@ module Search =
| Invalid -> fun _ -> () )
Role "option"
HTMLAttr.Custom ("aria-selected", (sug = selected))
OnClick (fun e -> match sug.Valid with
OnClick (fun _ -> match sug.Valid with
| Valid filter ->
unfocus ()
dispatch (FilterSet (filter, sug.Text))
......@@ -198,6 +198,11 @@ module Search =
if model.InFocus then
yield div [ Id "search-suggestions" ]
[ ul [ Role "listbox" ]
(model.Suggestions |> List.map (sugLi dispatch model.SelectedSuggestion)) ] ]
(model.Suggestions |> List.map (sugLi dispatch model.SelectedSuggestion)) ]
if model.Filter <> ShowAll then
yield a [ Role "button"
OnClick <| fun _ -> dispatch (FilterSet (ShowAll, ""))
Id "remove-filter-link" ]
[ str "Remove filter"] ]
div [ TabIndex -1
Props.Ref (fun elem -> Refs.unfocusDiv <- elem :?> Browser.HTMLElement) ] [ ] ]
......@@ -336,6 +336,9 @@ section {
#search .input-wrapper {
margin: 1.5em 0 0.5em;
min-width: 100%;
display: flex;
flex-flow: column nowrap;
align-items: flex-end;
}
@media (min-width: 550px) {
......@@ -357,6 +360,12 @@ section {
border-bottom-right-radius: 0;
}
#search #remove-filter-link {
font-size: 0.8rem;
margin-bottom: -0.8rem;
cursor: pointer;
}
#search-suggestions {
margin: 0;
width: 100%;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment