fx-compat: Item box: Prevent tabbing to hidden firstName

This commit is contained in:
Abe Jellinek 2022-08-04 17:20:01 -04:00
parent fbc2583433
commit 080ada78ee

View file

@ -2233,7 +2233,9 @@
if (back) { if (back) {
Zotero.debug('Looking for previous tabindex before ' + tabindex, 4); Zotero.debug('Looking for previous tabindex before ' + tabindex, 4);
for (let i = tabbableFields.length - 1; i >= 0; i--) { for (let i = tabbableFields.length - 1; i >= 0; i--) {
if (parseInt(tabbableFields[i].getAttribute('ztabindex')) < tabindex) { let field = tabbableFields[i];
let tabIndexHere = parseInt(field.getAttribute('ztabindex'));
if (tabIndexHere !== -1 && tabIndexHere < tabindex) {
next = tabbableFields[i]; next = tabbableFields[i];
break; break;
} }
@ -2242,7 +2244,9 @@
else { else {
Zotero.debug('Looking for tabindex ' + tabindex, 4); Zotero.debug('Looking for tabindex ' + tabindex, 4);
for (var pos = 0; pos < tabbableFields.length; pos++) { for (var pos = 0; pos < tabbableFields.length; pos++) {
if (parseInt(tabbableFields[pos].getAttribute('ztabindex')) >= tabindex) { let field = tabbableFields[pos];
let tabIndexHere = parseInt(field.getAttribute('ztabindex'));
if (tabIndexHere !== -1 && tabIndexHere >= tabindex) {
next = tabbableFields[pos]; next = tabbableFields[pos];
break; break;
} }