···77const INTERACTIVE_SELECTOR =
88 "button, a, input, select, textarea, [role='button'], tr, li, ul, .section-toggle";
991010-// apply `tabIndex=-1` to ALL interactive elements, only queue and library get tabIndex=0
1010+// things that should always be tabbable
1111+const ALWAYS_TABBABLE = new Set([
1212+ DOM_IDS.QUEUE,
1313+ DOM_IDS.LIBRARY,
1414+ DOM_IDS.LIBRARY_SEARCH,
1515+]);
1616+1717+// apply `tabIndex=-1` to interactive elements, except for queue, library, search
1818+// why? we have custom navigation (*-selection.js), keyboard shortcuts, and context menus that's much more intuitive than tabbing through every single button
1919+// if there are accessibility concerns, please let me know!!
1120function lockTabOrder() {
1221 document.querySelectorAll(INTERACTIVE_SELECTOR).forEach((el) => {
1313- // skip queue and library which are always tabbable
1414- if (el.id === DOM_IDS.QUEUE || el.id === DOM_IDS.LIBRARY) return;
2222+ // skip elements that are always tabbable
2323+ if (ALWAYS_TABBABLE.has(el.id)) return;
15241625 // skip if element is inside a modal
1726 const modal = el.closest(".modal:not(.hidden)");