From dbce38ad67c293a930ca666db341e64cceae2b56 Mon Sep 17 00:00:00 2001 From: "Umang G. Patel" <23169768+robonetphy@users.noreply.github.com> Date: Sat, 23 Jul 2022 18:09:29 +0530 Subject: [PATCH] keyup and keydown replace with input --- src/frontend/js/modules/sidebar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/frontend/js/modules/sidebar.js b/src/frontend/js/modules/sidebar.js index 6ae781a..64b989a 100644 --- a/src/frontend/js/modules/sidebar.js +++ b/src/frontend/js/modules/sidebar.js @@ -82,8 +82,7 @@ export default class Sidebar { className = Sidebar.CSS.sidebarSearchWrapperMac; } this.nodes.search.parentElement.classList.add(className); - this.nodes.search.addEventListener('keydown', e => this.search(e)); - this.nodes.search.addEventListener('keyup', e => this.search(e)); + this.nodes.search.addEventListener('input', e => this.search(e)); this.ready(); } @@ -199,12 +198,13 @@ export default class Sidebar { if (e.ctrlKey && e.code === 'KeyP') { this.nodes.search.focus(); e.preventDefault(); - e.stopImmediatePropagation(); } if (this.nodes.search === document.activeElement) { if (e.code === 'ArrowUp') { + console.log("up"); } if (e.code === 'ArrowDown') { + console.log("down"); } e.stopImmediatePropagation(); e.preventDefault();