mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-08-08 15:05:26 +02:00
keyup and keydown replace with input
This commit is contained in:
parent
80d2b9d166
commit
dbce38ad67
1 changed files with 3 additions and 3 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue