Skip to content

Commit

Permalink
Escape key clears input (closes #9)
Browse files Browse the repository at this point in the history
  • Loading branch information
haukex committed Jul 20, 2024
1 parent 320670c commit 8f7401d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ window.addEventListener('DOMContentLoaded', async () => {
// Trigger a search upon loading
search_from_url()

search_term.addEventListener('keyup', evt => {
// Escape key clears input
if (evt.key=='Escape')
search_term.value = ''
})

// Put the focus on the input field
search_term.focus()

Expand Down

0 comments on commit 8f7401d

Please sign in to comment.