Fix key navigation between select inputs
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 <maxi_kroeg@web.de>
This commit is contained in:
parent
efae3a98e0
commit
452e7a69f5
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user