Skip to content

Commit

Permalink
Make ESC great again
Browse files Browse the repository at this point in the history
  • Loading branch information
aerosol committed Sep 13, 2023
1 parent 7960637 commit 0f42b57
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion assets/js/liveview/suggestions_dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ let suggestionsDropdown = function(id) {
return currentFocus - 1 >= this.leastFocusableIndex() ? currentFocus - 1 : this.maxFocusableIndex()
},
close(e) {
if (this.isOpen) {
// Pressing Escape should not propagate to window,
// so we'll only close the suggestions pop-up
if (this.isOpen && e.key === "Escape") {
e.stopPropagation()
}
this.isOpen = false
Expand Down

0 comments on commit 0f42b57

Please sign in to comment.