From 0d6fe32f309285637311468e53c7026820229011 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 6 Oct 2020 12:43:31 +0200 Subject: [PATCH] clear filter on esc --- src/ui/web/session/leftpanel/LeftPanelView.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/web/session/leftpanel/LeftPanelView.js b/src/ui/web/session/leftpanel/LeftPanelView.js index 6688b537..f262e954 100644 --- a/src/ui/web/session/leftpanel/LeftPanelView.js +++ b/src/ui/web/session/leftpanel/LeftPanelView.js @@ -27,6 +27,12 @@ export class LeftPanelView extends TemplateView { autocomplete: true, name: "room-filter", onInput: event => vm.setFilter(event.target.value), + onKeydown: event => { + if (event.key === "Escape" || event.key === "Esc") { + filterInput.value = ""; + vm.clearFilter(); + } + } }); return t.div({className: "LeftPanel"}, [ t.div({className: "filter"}, [