Skip to content

fix(react-headless-components-preview): descendant clicks no longer trigger dialog backdrop dismissal#36245

Merged
mainframev merged 3 commits into
microsoft:masterfrom
mainframev:fix/headless-dialog-backdrop-click-on-descendant
May 26, 2026
Merged

fix(react-headless-components-preview): descendant clicks no longer trigger dialog backdrop dismissal#36245
mainframev merged 3 commits into
microsoft:masterfrom
mainframev:fix/headless-dialog-backdrop-click-on-descendant

Conversation

@mainframev
Copy link
Copy Markdown
Contributor

Enter or Space on a focused <button> inside the dialog dispatched a synthetic click with clientX/Y === 0. The click bubbled to the dialog and was interpreted as a backdrop click, dialog closed before any descendant handler could run (e.g. a PopoverTrigger failed to open its popover).

Previous Behavior

Screen.Recording.2026-05-25.at.17.50.47.mov

New Behavior

DialogSurface.handleClick now early-returns when event.target !== event.currentTarget. Only events that originated directly on the <dialog> element itself reach geometric check

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-headless-components-preview
react-headless-components-preview: entire library
165.054 kB
47.665 kB
165.095 kB
47.67 kB
41 B
5 B

🤖 This report was generated against 9317e51771e26f6142b72bb6f689aa9731218273

@github-actions
Copy link
Copy Markdown

Pull request demo site: URL

@mainframev mainframev marked this pull request as ready for review May 25, 2026 17:05
@mainframev mainframev requested a review from a team as a code owner May 25, 2026 17:05
@mainframev mainframev changed the title fix(headless-dialog): descendant clicks no longer trigger dialog backdrop dismissal fix(react-headless-components-preview): descendant clicks no longer trigger dialog backdrop dismissal May 25, 2026
mainframev and others added 3 commits May 26, 2026 11:56
…ef-4149-bfc7-e30efaac9d70.json

Co-authored-by: Dmytro Kirpa <kirpadv@gmail.com>
@mainframev mainframev force-pushed the fix/headless-dialog-backdrop-click-on-descendant branch from 922df54 to e64f5dc Compare May 26, 2026 10:23
@mainframev mainframev merged commit 1321fff into microsoft:master May 26, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants