Make search in stats page trigger onChange (#2428)

This commit is contained in:
yellowjello 2023-03-10 22:07:49 -08:00 committed by GitHub
parent 7fbff43a58
commit 9b5148185a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -114,6 +114,7 @@ Kaben Nanlohy <kaben.nanlohy@gmail.com>
Tobias Predel <tobias.predel@gmail.com> Tobias Predel <tobias.predel@gmail.com>
Daniel Tang <danielzgtg.opensource@gmail.com> Daniel Tang <danielzgtg.opensource@gmail.com>
Jack Pearson <github.com/jrpear> Jack Pearson <github.com/jrpear>
yellowjello <github.com/yellowjello>
******************** ********************

View file

@ -55,12 +55,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
} }
} }
function searchKeyUp(event: KeyboardEvent): void { function updateSearch(): void {
// fetch data on enter
if (event.code === "Enter") {
$search = displayedSearch; $search = displayedSearch;
} }
}
const year = tr.statisticsRange_1YearHistory(); const year = tr.statisticsRange_1YearHistory();
const deck = tr.statisticsRangeDeck(); const deck = tr.statisticsRangeDeck();
@ -89,7 +86,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<input <input
type="text" type="text"
bind:value={displayedSearch} bind:value={displayedSearch}
on:keyup={searchKeyUp} on:change={updateSearch}
on:focus={() => { on:focus={() => {
searchRange = SearchRange.Custom; searchRange = SearchRange.Custom;
}} }}