diff --git a/.changeset/empty-trees-fetch.md b/.changeset/empty-trees-fetch.md new file mode 100644 index 0000000000..7643076741 --- /dev/null +++ b/.changeset/empty-trees-fetch.md @@ -0,0 +1,5 @@ +--- +"@skeletonlabs/skeleton": patch +--- + +bugfix: fixed focusTrap escaping hidden inputs diff --git a/packages/skeleton/src/lib/actions/FocusTrap/focusTrap.ts b/packages/skeleton/src/lib/actions/FocusTrap/focusTrap.ts index 6c5846b879..3deb7a4129 100644 --- a/packages/skeleton/src/lib/actions/FocusTrap/focusTrap.ts +++ b/packages/skeleton/src/lib/actions/FocusTrap/focusTrap.ts @@ -1,6 +1,7 @@ // Action: Focus Trap export function focusTrap(node: HTMLElement, enabled: boolean) { - const elemWhitelist = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])'; + const elemWhitelist = + 'a[href]:not([tabindex="-1"]), button:not([tabindex="-1"]), input:not([tabindex="-1"]), textarea:not([tabindex="-1"]), select:not([tabindex="-1"]), details:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"])'; let elemFirst: HTMLElement; let elemLast: HTMLElement;