Skip to content

[dialog][alert-dialog] Correct inaccurate prop JSDoc - #5035

Closed
atomiks wants to merge 4 commits into
mui:masterfrom
atomiks:dialog/prop-jsdoc-fixes
Closed

atomiks wants to merge 4 commits into
mui:masterfrom
atomiks:dialog/prop-jsdoc-fixes

Conversation

@atomiks

@atomiks atomiks commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

⚠️ Stacked on #5034. Diff is cumulative until it merges — review this branch's top commit.

Corrects inaccurate public prop JSDoc (regenerated API reference included):

  • disablePointerDismissal — the description was inverted (and omitted that for non-modal dialogs it also disables closing on focus-out).
  • actionsRef — the unmount action requires calling eventDetails.preventUnmountOnClose() from onOpenChange; specifying the ref alone no longer prevents unmount.
  • Dialog.Trigger state — disabled reflects the trigger (not the dialog); open is true only when the dialog is open and was opened by that trigger.
  • Dialog.Popup initialFocus/finalFocus — document the null-fallback and the touch default (the popup itself is focused on touch).
  • Document createAlertDialogHandle.

atomiks added 4 commits June 12, 2026 16:51
A trigger that mounts while a popup is already open (via a handle's
openWithPayload/open(null)) would claim ownership and overwrite the
programmatic payload. Track openedWithoutTrigger in the popup store and skip
the implicit, registration-time, and single-trigger ARIA (aria-controls) claim
paths for such opens; reset the flag on close so a later non-imperative open
(controlled/defaultOpen) isn't affected. DialogHandle.open records trigger
intent so handle.open(id) before mount still associates. Adds regression tests
for payload preservation and the absent ARIA association. (B5)
- Aggregate nested dialog/drawer counts per child (keyed by a stable id, via
  Math.max) so closing one sibling no longer zeroes the parent while another
  stays open, which also fixes Escape/outside-press topmost gating (B4).
- Accept touchend outside-press by counting changedTouches instead of the now-empty
  touches list (B6).
- Seed store state directly on first render instead of store.update() so detached
  trigger subscribers aren't notified mid-render (B7).
- Seed a reused handle store's openProp on first render so an initially-open
  dialog doesn't play an enter transition (B8).
- Report the trigger on close using the triggerIdProp-aware selector (B9).
- Add a nested sibling-close regression test.
- Drop the redundant mergeProps(FOCUSABLE_POPUP_PROPS, dismiss.floating); both
  popup consumers already spread FOCUSABLE_POPUP_PROPS (S4).
- Extract the shared touch default-initial-focus resolver into
  createDefaultInitialFocus, used by Dialog and Popover popups (S5).
- Return void from useDialogRoot, pass parentContext/isDrawer to DialogInteractions
  directly, and drop the dead UseDialogRoot* interfaces and eventTarget alias (S7).
- Add a default touch initialFocus regression test.
- disablePointerDismissal: describe what it actually does (prevent closing on
  outside press, plus focus-out for non-modal); the old text was inverted (C1).
- actionsRef: the unmount action requires eventDetails.preventUnmountOnClose()
  in onOpenChange, not merely providing the ref (C2).
- DialogTrigger state: 'disabled' reflects the trigger; 'open' is true only when
  this trigger opened the dialog (C5, C6).
- DialogPopup initialFocus/finalFocus: document the null fallback and the touch
  default (C7).
- Document createAlertDialogHandle (C13).
- Regenerate the API reference.
@atomiks atomiks added component: alert dialog Changes related to the alert dialog component. component: dialog Changes related to the dialog component. labels Jun 12, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 12, 2026

Copy link
Copy Markdown
  • base-ui-tanstack-start

  • vite-css-base-ui-example

    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/react@5035
    
    pnpm add https://pkg.pr.new/mui/base-ui/@base-ui/utils@5035
    

commit: b0718d1

@code-infra-dashboard

code-infra-dashboard Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

Bundle size

Bundle Parsed size Gzip size
@base-ui/react 🔺+496B(+0.11%) 🔺+168B(+0.11%)

Details of bundle changes

Performance

Total duration: 1,225.19 ms -229.06 ms(-15.8%) | Renders: 50 (+0) | Paint: 1,852.02 ms -332.37 ms(-15.2%)

Test Duration Renders
Checkbox mount (500 instances) 70.29 ms ▼-43.80 ms(-38.4%) 1 (+0)
Menu open (500 items) 65.18 ms ▼-18.00 ms(-21.6%) 12 (+0)

10 tests within noise — details


Check out the code infra dashboard for more information about this PR.

@netlify

netlify Bot commented Jun 12, 2026

Copy link
Copy Markdown

✅ Deploy Preview for base-ui ready!

Name Link
🔨 Latest commit b0718d1
🔍 Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6a2bad44211a7a000839a7f2
😎 Deploy Preview https://deploy-preview-5035--base-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@atomiks

atomiks commented Jun 12, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #5036, which fixes the same JSDoc rot across all components instead of just Dialog/AlertDialog.

@atomiks atomiks closed this Jun 12, 2026
@atomiks
atomiks deleted the dialog/prop-jsdoc-fixes branch June 12, 2026 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: alert dialog Changes related to the alert dialog component. component: dialog Changes related to the dialog component.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant