From 452e7a69f5b71f6406fd640df3b5e3c3ee407431 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Sat, 26 Nov 2022 01:56:10 +0100 Subject: [PATCH] Fix key navigation between select inputs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This compatibility fix is no longer necessary. As a side note: It checked versions from 3 to 24 but actually also matched all versions >= 30 as no word boundary check was made on the version number Signed-off-by: Maximilian Krög --- js/src/keyhandler.js | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/js/src/keyhandler.js b/js/src/keyhandler.js index 83d2a3dc07..48066a0b46 100644 --- a/js/src/keyhandler.js +++ b/js/src/keyhandler.js @@ -70,9 +70,6 @@ function onKeyDownArrowsHandler (event) { return; } - // eslint-disable-next-line compat/compat - var isFirefox = navigator.userAgent.toLowerCase().indexOf('firefox/') > -1; - var id = 'field_' + y + '_' + x; var nO = document.getElementById(id); @@ -86,39 +83,8 @@ function onKeyDownArrowsHandler (event) { return; } - // for firefox select tag - var lvalue = o.selectedIndex; - var nOvalue = nO.selectedIndex; - nO.focus(); - if (isFirefox) { - var ffcheck = 0; - var ffversion; - for (ffversion = 3 ; ffversion < 25 ; ffversion++) { - var isFirefoxV24 = navigator.userAgent.toLowerCase().indexOf('firefox/' + ffversion) > -1; - if (isFirefoxV24) { - ffcheck = 1; - break; - } - } - if (ffcheck === 1) { - if (e.which === 38 || e.which === 37) { - nOvalue++; - } else if (e.which === 40 || e.which === 39) { - nOvalue--; - } - nO.selectedIndex = nOvalue; - } else { - if (e.which === 38 || e.which === 37) { - lvalue++; - } else if (e.which === 40 || e.which === 39) { - lvalue--; - } - o.selectedIndex = lvalue; - } - } - if (nO.tagName !== 'SELECT') { nO.select(); }