Prevent search focus change on left/right arrow press

For #3920
This commit is contained in:
Dan Brown 2022-12-16 17:03:48 +00:00
parent 69d702c783
commit 2c0a7346b1
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9

View File

@ -57,6 +57,12 @@ export class KeyboardNavigationHandler {
* @param {KeyboardEvent} event
*/
#keydownHandler(event) {
// Ignore certain key events in inputs to allow text editing.
if (event.target.matches('input') && (event.key === 'ArrowRight' || event.key === 'ArrowLeft')) {
return;
}
if (event.key === 'ArrowDown' || event.key === 'ArrowRight') {
this.focusNext();
event.preventDefault();