github chakra-ui/zag @zag-js/dismissable@2.0.0-next.4

Major Changes

  • #3342
    08ea850 Thanks
    @github-actions! - Zag no longer sets a z-index on overlays. Set it in
    CSS, using --layer-index for the overlay's place in the stack.

    • Fix a z-index set on the positioner in CSS being overridden.

    • Fix overlays dropping behind other layers while they animate out. --layer-index stays set after close.

    Breaking: Move the z-index to the positioner (or the backdrop) and add --layer-index.

    - [data-popover-content] {
    + [data-popover-positioner] {
    -   z-index: 1400;
    +   z-index: calc(1400 + var(--layer-index));
      }
    • Popover, menu, select, combobox, hover card, tooltip, date picker, color picker and cascade select no longer copy
      the content's z-index onto the positioner or set --z-index.

    • Dialog and drawer no longer set --z-index. Use --layer-index on the backdrop and positioner.

    • The floating panel no longer sets a z-index. Style the positioner as above to bring the focused panel to the
      front.

    • The tour no longer copies the content's z-index onto dialog steps. Style the positioner with --tour-layer.

    • The toast group no longer sets an inline z-index. Set it on [data-toast-group] in CSS.

    • Remove the zIndex and zIndexFallback options from getDismissableLayerStyle.

Minor Changes

  • #3342
    4f28f36 Thanks
    @github-actions! - - Add reason to onOpenChange details, such as
    trigger-click, escape-key, interact-outside, item-select or script. Each component exports its
    OpenChangeReason type.

    • Add an optional reason to api.setOpen(open, reason), defaulting to script.

Patch Changes

  • #3642
    a87b07c Thanks
    @segunadebayo! - - Fix opening a menu while a sibling menu is open closing both.

  • #3570
    cb8e73d Thanks
    @Adebesin-Cell! - - Fix the page freezing when many overlays are open at once.

    • Fix closing one overlay also closing unrelated overlays opened after it.

    • Fix Escape closing the outer layer first when nested layers open together on mount.

    • Fix unmounting nested layers firing onOpenChange for children that unmount too.

    • Fix a layer that opens while its parent is closing being dismissed with it.

  • Updated dependencies [cb8e73d,
    a80b307]:

    • @zag-js/interact-outside@2.0.0-next.4
    • @zag-js/dom-query@2.0.0-next.4
    • @zag-js/utils@2.0.0-next.4

Don't miss a new zag release

NewReleases is sending notifications on new releases.