Component changelog

Dialog changelog

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

Release

v1.1.2

npm
Patch Changes
  • f70cd18Fix Dialog.Close and AlertDialog.Cancel types so they accept standard button props.

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
  • 05c0ccb: Add defaultOpen to Dialog.Root and fix controlled/uncontrolled handling

    DialogPrimitive.Root now accepts defaultOpen for uncontrolled usage and switches from hand-rolled useState + useEffect syncing to the existing useControllableState hook.

    This also fixes controlled mode. Previously open was seeded into local state and re-synced by an effect, so a controlled dialog still opened when the trigger was clicked even though the parent held open={false} — the effect only re-ran when open itself changed. With useControllableState, a defined open is authoritative: the dialog reports the request through onOpenChange and waits for the parent to update.

    AlertDialog inherits the same fix. Its onOpenChange test asserted the old behaviour (clicking the trigger opened a controlled dialog) and now asserts correct controlled semantics: the request fires, the dialog stays closed until the parent rerenders with open={true}.

  • 55d0806: fix(dialog): merge consumer props through getItemProps on Action and Cancel

    DialogPrimitiveAction and DialogPrimitiveCancel spread consumer props after the props returned by getItemProps, so a consumer handler replaced the library's own handler instead of running alongside it.

    On Action, passing an onClick silently suppressed the close: the internal handleOpenChange(false) was overwritten, so the dialog stayed open.

    Both parts now pass consumer props into getItemProps and compose onClick explicitly, so the consumer handler runs first and the dialog still closes:

    {...getItemProps({
        ...props,
        onClick: (e) => {
            onClick?.(e);
            handleOpenChange(false);
        }
    })}

    DialogPrimitiveContextType also widens getItemProps, getReferenceProps and getFloatingProps to accept optional user props, and the default context value returns those props unchanged instead of {}.

  • ebcab1f: Expose Dialog trigger data-state, data-disabled, and aria-expanded attributes from the primitive.

  • 1ec9c6d: fix(drawer): resolve peekStyle temporal dead zone in DrawerContent

    DrawerContent referenced peekStyle inside the getFloatingProps call before the variable was declared further down the component body. The const declarations sat below an early return, so the reference landed in the temporal dead zone. The file failed to type-check, which broke four Drawer test suites at compile time.

    Hoisting the peekOffset/peekStyle pair above the getFloatingProps call fixes the ordering. getFloatingProps is also cast to its user-props signature, matching the convention already used by Dialog, Combobox and Menu.

  • 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.

  • 6c18fcb: docs(a11y): add ARIA references for alert dialog, context menu, and menubar