Skip to content

@zag-js/dom-query@1.43.0

Choose a tag to compare

@github-actions github-actions released this 29 Jul 15:16
b24c84b

Minor Changes

  • 0d23ef3 Thanks
    @segunadebayo! - Improve initial focus selection in dialogs and drawers. Mark
    chrome controls with data-no-autofocus to skip them, or mark the desired target with data-autofocus.

    <div {...api.getContentProps()}>
      {/* skipped on open, still in tab order */}
      <button {...api.getCloseTriggerProps()} data-no-autofocus>
        Close
      </button>
      <button data-no-autofocus aria-label="Help">
        ?
      </button>
    
      {/* receives initial focus */}
      <input data-autofocus />
      <button>Save</button>
    </div>

    Priority: initialFocusEl[data-autofocus] → first tabbable without [data-no-autofocus] → content root.

Patch Changes

  • 4e06700 Thanks
    @segunadebayo! - Fix proxyTabFocus so tabbing out of portalled content moves to
    the next tabbable after the trigger, instead of looping back into the content when the trigger is last on the page.

  • 53944e0 Thanks
    @segunadebayo! - Compose data-ownedby values when merging props, match owners as
    tokens in DOM queries, and expose isOwnedBy for membership checks.

  • Updated dependencies []:

    • @zag-js/types@1.43.0