github chakra-ui/zag @zag-js/hover-card@2.0.0-next.2

Minor Changes

  • #3252
    45451e9 Thanks
    @github-actions! - Add a reason to onOpenChange, describing what caused
    the change.

    • Added reason to onOpenChange details: trigger-hover, trigger-focus, trigger-blur, pointer-leave,
      interact-outside, escape-key or script. api.setOpen accepts a reason as its second argument, defaulting to
      script.
    • Fixed issue where dismissing with the Escape key was reported the same way as pressing outside.
    • Fixed issue where leaving the trigger before the open delay elapsed fired onOpenChange with open: false, even
      though the hover card had never opened.
  • #3252
    afdeee4 Thanks
    @github-actions! - Add inline positioning for references that wrap across
    lines.

    • Fixed issue where a hover card anchored to a trigger spanning multiple lines was positioned against the box covering
      every line, landing far from the pointer instead of under the line being hovered.
    • Fixed issue where the hover card stayed over the previous trigger when the active trigger changed, showing the new
      trigger's content in the old position.
    • Added inline and getInlineRectCoords to @zag-js/popper, alongside a positioning.middleware option for
      supplying extra Floating UI middleware. The middleware is only bundled by machines that import it.
  • #3252
    d402e9c Thanks
    @github-actions! - Add @zag-js/safe-area and use it in the hover card to
    track the pointer travelling between the trigger and the content.

    • Fixed issue where the hover card closed while the pointer was still on its way to the content. Moving diagonally, or
      pausing for longer than closeDelay, no longer dismisses it.
    • Fixed issue where a hover card opened programmatically or by keyboard was dismissed by pointer movement anywhere on
      the page.

    The open and closing states are now open.idle and open.closing. state.matches("open") still works, but code
    matching the literal state "closing" should use "open.closing".

    The tooltip uses it too when interactive is set, so the pointer can reach a hoverable tooltip without it closing on
    the way (WCAG 1.4.13). Non-interactive tooltips are unchanged.

Patch Changes

  • #3252
    f7f9abf Thanks
    @github-actions! - Fixed issue where the hover card opened on focus that
    followed a pointer interaction, such as a dialog restoring focus to the trigger. It now opens only for keyboard and
    assistive-technology focus, matching @zag-js/tooltip.
  • Updated dependencies [2668edc,
    06ddeb3,
    021c599,
    2859ef6,
    82692cd,
    afdeee4,
    6d57458,
    734b5e8,
    d402e9c,
    e8b99d2,
    2859ef6,
    2859ef6,
    2859ef6]:
    • @zag-js/dom-query@2.0.0-next.2
    • @zag-js/dismissable@2.0.0-next.2
    • @zag-js/focus-visible@2.0.0-next.2
    • @zag-js/popper@2.0.0-next.2
    • @zag-js/core@2.0.0-next.2
    • @zag-js/types@2.0.0-next.2
    • @zag-js/utils@2.0.0-next.2
    • @zag-js/safe-area@2.0.0-next.2
    • @zag-js/anatomy@2.0.0-next.2

Don't miss a new zag release

NewReleases is sending notifications on new releases.