clear filter on esc

This commit is contained in:
Bruno Windels 2020-10-06 12:43:31 +02:00
parent ddbe3305c8
commit 0d6fe32f30

View file

@ -27,6 +27,12 @@ export class LeftPanelView extends TemplateView {
autocomplete: true, autocomplete: true,
name: "room-filter", name: "room-filter",
onInput: event => vm.setFilter(event.target.value), 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"}, [ return t.div({className: "LeftPanel"}, [
t.div({className: "filter"}, [ t.div({className: "filter"}, [