Skip to content

Commit

Permalink
action-list.js: Fix console error
Browse files Browse the repository at this point in the history
- The browser cannot differ between auto-completed input and user input, which causes the onKeydown function to be triggered when browser suggestions for an input field are selected.
  • Loading branch information
sukhwinder33445 committed Jul 19, 2023
1 parent 79d89f9 commit b99bec8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions public/js/action-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@
let pressedArrowUpKey = event.key === 'ArrowUp';
let focusedElement = document.activeElement;

if (_this.isProcessingLoadMore || (
event.key.toLowerCase() !== 'a' && ! pressedArrowDownKey && ! pressedArrowUpKey
)) {
if (
_this.isProcessingLoadMore
|| ! event.key // input auto-completion is triggered
|| (event.key.toLowerCase() !== 'a' && ! pressedArrowDownKey && ! pressedArrowUpKey)
) {
return;
}

Expand Down

0 comments on commit b99bec8

Please sign in to comment.