Focus special handling of Shift+Tab on macOS

This commit is contained in:
Henrik Giesel 2020-12-21 08:00:47 +01:00
parent 165007180a
commit 2ae4d14bc5

View file

@ -54,12 +54,6 @@ function onKey(evt: KeyboardEvent) {
currentField.blur(); currentField.blur();
return; return;
} }
// shift+tab goes to previous field
if (navigator.platform === "MacIntel" && evt.which === 9 && evt.shiftKey) {
evt.preventDefault();
focusPrevious();
return;
}
// fix Ctrl+right/left handling in RTL fields // fix Ctrl+right/left handling in RTL fields
if (currentField.dir === "rtl") { if (currentField.dir === "rtl") {
@ -206,16 +200,6 @@ function focusField(n) {
$("#f" + n).focus(); $("#f" + n).focus();
} }
function focusPrevious() {
if (!currentField) {
return;
}
const previous = currentFieldOrdinal() - 1;
if (previous >= 0) {
focusField(previous);
}
}
function focusIfField(x, y) { function focusIfField(x, y) {
const elements = document.elementsFromPoint(x, y); const elements = document.elementsFromPoint(x, y);
for (let i = 0; i < elements.length; i++) { for (let i = 0; i < elements.length; i++) {