fx-compat: Item box: Set control attribute on label

For accessibility.
This commit is contained in:
Abe Jellinek 2023-04-03 17:09:37 -04:00
parent 94c5717052
commit 16411422c8

View file

@ -1496,7 +1496,7 @@
async showEditor(elem) { async showEditor(elem) {
Zotero.debug(`Showing editor for ${elem.getAttribute('fieldname')}`); Zotero.debug(`Showing editor for ${elem.getAttribute('fieldname')}`);
var label = elem.closest('tr').querySelector('th'); var label = elem.closest('tr').querySelector('th > label');
var lastTabIndex = this._lastTabIndex = parseInt(elem.getAttribute('ztabindex')); var lastTabIndex = this._lastTabIndex = parseInt(elem.getAttribute('ztabindex'));
// If a field is open, hide it before selecting the new field, which might // If a field is open, hide it before selecting the new field, which might
@ -1923,7 +1923,7 @@
Zotero.debug(`Hiding editor for ${textbox.getAttribute('fieldname')}`); Zotero.debug(`Hiding editor for ${textbox.getAttribute('fieldname')}`);
var label = textbox.closest('tr').querySelector('th'); var label = textbox.closest('tr').querySelector('th > label');
this._lastTabIndex = -1; this._lastTabIndex = -1;
// Prevent autocomplete breakage in Firefox 3 // Prevent autocomplete breakage in Firefox 3