Clear query when clearing input

This commit is contained in:
Nicholas Zuber 2020-11-02 19:11:50 -05:00
parent ac1a28a05f
commit 369d8f4bca
2 changed files with 3 additions and 0 deletions

View File

@ -190,6 +190,7 @@ function filterFromQuery({query, items, compare}) {
export function FilterSearch({ export function FilterSearch({
isSearching, isSearching,
activeQuery, activeQuery,
clearQuery,
dark, dark,
notifications, notifications,
view, view,
@ -245,6 +246,7 @@ export function FilterSearch({
const {filter, text} = parseTextForFilter(input, activeFilter); const {filter, text} = parseTextForFilter(input, activeFilter);
setSearchInput(text); setSearchInput(text);
if (input === '') { if (input === '') {
clearQuery();
setActiveFilter(null); setActiveFilter(null);
} else { } else {
setActiveFilter(filter); setActiveFilter(filter);

View File

@ -787,6 +787,7 @@ function Scene({
<FilterSearch <FilterSearch
notifications={allNotifications} notifications={allNotifications}
activeQuery={query} activeQuery={query}
clearQuery={onClearQuery}
view={view} view={view}
dark={darkMode} dark={darkMode}
loading={loading} loading={loading}