Component changelog

Popover changelog

Component-specific release notes collected from the full changelog. This page filters the published entries that mention Popover.

Release

v1.2.1

npm
Patch Changes
  • 2d81c52: Triggers rendered with asChild keep the child's own semantics. A link inside Tooltip.Trigger, Popover.Trigger, Dialog.Trigger or any other trigger used to get role="button" and type="button", so screen readers announced it as a button. Now a link stays a link, a native button keeps its own type, and only other elements (a span, a div) get role="button". Button already worked this way; every trigger now does too (#2332).

  • 47693b3: Select.Content, Combobox.Content and Autocomplete.Content accept side, align, sideOffset and alignOffset, as Popover.Content and Tooltip.Content do. They used to work only on the Root; on Content they were silently passed to the DOM, and React warned about unknown props. Values on Content win over the Root's (#2335).

Release

v1.2.0

npm
Minor Changes
  • befc825: Dialog, AlertDialog, Popover, Tooltip, HoverCard, menus, Select, Combobox and NavigationMenu take actionsRef with close(). Field and Form take actionsRef with validate(). Field takes controlled touched and dirty, and Field.Control takes onValueChange.

  • befc825: Tooltip, HoverCard and Popover Content, menu Roots and the Select/Combobox/Autocomplete Root take anchor (an element, virtual element, ref or function to position against instead of the trigger), positionMethod, collisionAvoidance (flip, shift or none per axis), sticky and disableAnchorTracking.

  • 07e6783: Tooltip.Content and HoverCard.Content take side, align, sideOffset and alignOffset, like Popover.Content, and expose the resolved data-side and data-align. HoverCard could only open below its trigger before. Tooltip.Root's placement still works when side isn't set. A style prop on HoverCard.Content no longer replaces its positioning styles.

  • befc825: HoverCard.Root's onOpenChange gets details (reason, event, cancel()) as a second argument, and triggers take delay and closeDelay that override the Root's. Popover.Trigger takes openOnHover, delay and closeDelay.

  • 07e6783: Add onOpenChangeComplete to Dialog, AlertDialog and Popover roots: it's called with true once the open animation finishes and with false once the close animation finishes and the content unmounts (immediately when nothing animates). Useful for moving focus, resetting forms or loading data after a transition.

  • 07e6783: onOpenChange details also come from DropdownMenu, ContextMenu, Menubar menus, Select, Combobox and Tooltip, with an item-press reason when picking an item closes the popup. As with Dialog and Popover, only handlers that take a second argument receive them.

  • 07e6783: Popover, Dialog and AlertDialog onOpenChange handlers that take a second argument receive details: the reason (trigger-press, outside-press, escape-key, focus-out, close-press and more), the DOM event, and cancel() to keep the current state, for example an "unsaved changes" guard. Handlers that take one argument are called exactly as before. This matches Drawer, which already worked this way.

  • 07e6783: Popover supports detached triggers. Create a handle with Popover.createHandle() and pass it to Popover.Root and to triggers rendered anywhere, each with a payload. The popover anchors to whichever trigger opened it, its children can be a function of the payload, and clicking the open trigger again closes it.

  • 07e6783: Add initialFocus and finalFocus to Popover.Content, matching Dialog: choose where focus goes when the popover opens (first tabbable element, stay on the trigger, or a ref) and where it returns when it closes (the trigger, nowhere, or a ref). Each also accepts a function.

  • 07e6783: Add openOnHover to Popover.Root, with hoverOpenDelay (default 300ms) and hoverCloseDelay (default 0). The popover also opens while the pointer rests on the trigger, and the pointer can move into it without it closing. Clicking still toggles it, so touch and keyboard users aren't left out.

  • 07e6783: Popover.Root modal now also accepts "trap-focus": focus is trapped in the popover (and the page is hidden from assistive technology) while the rest of the page still takes pointer input. modal={true} and the default false are unchanged.

  • ed15256: Add triggerId and defaultTriggerId to Dialog, AlertDialog, Popover, Tooltip, HoverCard and DropdownMenu roots used with a handle: the DOM id of the detached trigger the popup belongs to. While open, the popup is anchored to that trigger, shows its payload and marks it aria-expanded, also when opened from code with open. Closing through a controlled open now releases the trigger too.

  • 07e6783: Popover, Tooltip, Dialog and AlertDialog content (and the Dialog overlay) support CSS transitions on enter and exit. Opening renders one frame with data-starting-style and closing sets data-ending-style, and the element stays mounted until its animations and transitions finish, so a plain transition on opacity or transform animates both ways. With no exit animation it unmounts at once, as before. Closed content still on screen can't be clicked or focused.

Patch Changes
  • ed15256: Popover and Dialog (and AlertDialog) now call onOpenChange(true, { reason: "trigger-press" }) when a detached trigger opens them, so they can be controlled with a handle; canceling it keeps them closed. A defaultOpen popup with a handle no longer closes itself on mount.

  • 589f4ba: Dialog, AlertDialog and Popover now play their closing transition: content and overlay stay mounted with data-state="closed" until the exit transition or animation finishes, then unmount (straight away with reduced motion or no animation). Focus still returns at the moment of closing.

Release

v1.1.0

npm
Patch Changes
  • 5a38eef: docs(guides): add a troubleshooting guide for SSR, portals, and focus

    New docs/app/docs/guides/troubleshooting page covering the integration failures that are otherwise spread across guides, organised as symptom / likely causes / what to try:

    • hydration mismatches on overlay and theme components
    • portal containers rendering in the wrong place or missing theme tokens
    • focus not restoring after a dialog, popover, or menu closes
    • focus traps that are too narrow or too wide
    • overlays flashing or never opening on first paint
    • scroll lock leaking after an overlay unmounts

    Registered in docsNavigationSections and cross-linked from the existing SSR & No-JS Fallback guide.

Release

v1.0.0

npm
Patch Changes
  • 66a89d5: Expose Popover anatomy data slots for root, anchor, trigger, content, close, and arrow parts.

  • 0ccabb4: fix(scrollarea): hide the scrollbar while a document overlay is open

    An overlay (Dialog, Menu, Popover, Combobox, Drawer) covers the page and locks body scroll, but a ScrollArea with type="always" still painted its scrollbar and thumb on top of it.

    Adds a document-level overlay registry and suppresses the scrollbar and thumb while any overlay is open:

    const isVisible =
      !overlaySuppressesScrollbar &&
      (type === "always" ||
        (type === "auto" && isOverflowing) ||
        (isOverflowing &&
          (type === "scroll" || type === "hover") &&
          scrollbarVisible));

    The registry is ref-counted and mirrors its state onto data-rad-ui-overlay-open on <html>, so overlays stack correctly (two open overlays decrement back to zero rather than clearing early). ScrollArea picks the state up via useDocumentOverlayOpenState, which also observes the attribute and body's inline style, so overlays from other libraries that only lock body scroll are covered too.

    resetDocumentOverlayOpenForTests is wired into the global afterEach in setupTests.ts so the registry cannot leak between suites.

Release

v0.6.0

npm
Patch Changes
  • b577317popover - improve radix api parity, modal focus behavior, arrow styling, and positioning stability