Filter query (#3740)

* Add search field to filter dialog
* Add / shortcut to focus query
* Fix f keybind typing f into query field
* Document keyboard shortcut
This commit is contained in:
WithoutPants
2023-05-19 12:36:53 +10:00
committed by GitHub
parent 0a14394113
commit 702101ecce
5 changed files with 78 additions and 9 deletions

View File

@@ -193,7 +193,13 @@ export function makeItemList<T extends QueryResult, E extends IDataItem>({
// set up hotkeys
useEffect(() => {
Mousetrap.bind("f", () => setShowEditFilter(true));
Mousetrap.bind("f", (e) => {
setShowEditFilter(true);
// prevent default behavior of typing f in a text field
// otherwise the filter dialog closes, the query field is focused and
// f is typed.
e.preventDefault();
});
return () => {
Mousetrap.unbind("f");