Skip to content

Commit

Permalink
search on enter
Browse files Browse the repository at this point in the history
  • Loading branch information
khaitruong922 committed Sep 19, 2024
1 parent 62c4287 commit 628c2dc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,5 +171,15 @@ const exportTxt = () => {
};

const btn = document.getElementById('search');
kanjiListInput.addEventListener('keydown', (e) => {
if (e.isComposing) {
return;
}
const { code, key } = e;
if (!(code === 'Enter' || key === 'Enter' || code === 'NumpadEnter')) {
return;
}
search();
});
btn.addEventListener('click', search);
exportTxtBtn.addEventListener('click', exportTxt);

0 comments on commit 628c2dc

Please sign in to comment.