From f6cffa4cf200e308789ee8852f7eee03fde20a9c Mon Sep 17 00:00:00 2001 From: Anne Haley Date: Thu, 4 Aug 2022 11:49:21 -0400 Subject: [PATCH] Disable arrowkey event listener if an input is focused (#556) --- web_client/src/components/ControlPanel.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/web_client/src/components/ControlPanel.vue b/web_client/src/components/ControlPanel.vue index 60165d44..348d3ee8 100644 --- a/web_client/src/components/ControlPanel.vue +++ b/web_client/src/components/ControlPanel.vue @@ -72,6 +72,7 @@ export default { if (!this.navigateToNextIfCurrentScanNull()) { this.switchLock(this.experimentId); window.addEventListener('keydown', (event) => { + if (['textarea', 'input'].includes(document.activeElement.type)) return; if (event.key === 'ArrowUp') { this.handleKeyPress('previous'); } else if (event.key === 'ArrowDown') {