Files
dashfront/src/components/article/searchFocus.js
2026-09-29 09:30:43 +02:00

9 lines
337 B
JavaScript

const FOCUSABLE =
'a, button, input, textarea, select, [role="button"], [role="menuitem"], [tabindex]:not([tabindex="-1"]), [contenteditable="true"]';
/** Keep the search field focused when clicking non-interactive chrome. */
export function preserveSearchFocus(e) {
if (e.target.closest(FOCUSABLE)) return;
e.preventDefault();
}