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>
Daniel Tang <danielzgtg.opensource@gmail.com>
Jack Pearson <github.com/jrpear>
yellowjello <github.com/yellowjello>
********************

View file

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