@polargold/pg-frontend-vue
    Preparing search index...

    Function useFocusTrap

    • Keeps Tab/Shift+Tab cycling within a container while active, and focuses its first focusable element on activation. Intended for modals/dialogs so keyboard focus can't silently leave into the page behind them.

      Byte-identical in luv-ui-library and bws-ui-library - found during a follow-up re-scan that also checked the *-ui-library component packages, not just *-ui-tools. Fully generic (no brand coupling), so it belongs here rather than in either brand's library.

      focusableSelector is optional - the default list covers the common interactive elements; pass your own if a container has something unusual (e.g. a custom element exposing tabindex dynamically).

      Parameters

      • container: Ref<HTMLElement | undefined>
      • focusableSelector: string = DEFAULT_FOCUSABLE_SELECTOR

      Returns { activate: () => void; deactivate: () => void }