Skip to content

[DOM] Blur portaled Fragment focus targets - #37161

Merged
jackpope merged 1 commit into
mainfrom
fragment-refs/blur-portaled-focus
Aug 12, 2026
Merged

[DOM] Blur portaled Fragment focus targets#37161
jackpope merged 1 commit into
mainfrom
fragment-refs/blur-portaled-focus

Conversation

@jackpope

@jackpope jackpope commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

focus() passes through portals as it attempts focus down the fiber tree. blur() exited early based on a containment check, causing it to stop at portals.

The result could be a focused element that cannot be blurred.

Follow up to #37125, which made blur() apply recursively to be consistent with focus().

@meta-cla meta-cla Bot added the CLA Signed label Jul 31, 2026
@jackpope
jackpope force-pushed the fragment-refs/blur-portaled-focus branch from f38a225 to f7f42fe Compare July 31, 2026 19:14
@github-actions github-actions Bot added the React Core Team Opened by a member of the React Core Team label Jul 31, 2026
@jackpope
jackpope force-pushed the fragment-refs/blur-portaled-focus branch from f7f42fe to 92c79b2 Compare July 31, 2026 20:15
@jackpope
jackpope requested a review from eps1lon July 31, 2026 21:07
@jackpope
jackpope marked this pull request as ready for review July 31, 2026 21:07
@jackpope
jackpope force-pushed the fragment-refs/blur-portaled-focus branch from 92c79b2 to 22ae639 Compare August 9, 2026 19:15
@jackpope
jackpope force-pushed the fragment-refs/blur-portaled-focus branch from 22ae639 to 03033f0 Compare August 11, 2026 03:49
Base automatically changed from fragment-refs/fix-remove-event-listener to main August 12, 2026 00:50
blur() early-exited when activeElement was outside the React host
parent, so focus() on portaled children could not be cleared.
@jackpope
jackpope force-pushed the fragment-refs/blur-portaled-focus branch from 03033f0 to 5fb7130 Compare August 12, 2026 00:50
@react-sizebot

Copy link
Copy Markdown

Comparing: 3cba19c...5fb7130

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.js = 7.35 kB 7.35 kB +0.05% 1.96 kB 1.96 kB
oss-stable/react-dom/cjs/react-dom-client.production.js = 619.92 kB 619.87 kB = 109.65 kB 109.64 kB
oss-experimental/react-dom/cjs/react-dom.production.js = 7.36 kB 7.36 kB +0.05% 1.96 kB 1.96 kB
oss-experimental/react-dom/cjs/react-dom-client.production.js = 691.13 kB 691.08 kB = 121.15 kB 121.14 kB
facebook-www/ReactDOM-prod.classic.js = 711.32 kB 711.28 kB = 124.60 kB 124.57 kB
facebook-www/ReactDOM-prod.modern.js = 701.64 kB 701.59 kB = 123.02 kB 122.99 kB

Significant size changes

Includes any change greater than 0.2%:

(No significant changes)

Generated by 🚫 dangerJS against 5fb7130

@jackpope
jackpope merged commit 278d318 into main Aug 12, 2026
238 checks passed
github-actions Bot pushed a commit that referenced this pull request Aug 12, 2026
focus() passes through portals as it attempts focus down the fiber tree.
blur() exited early based on a containment check, causing it to stop at
portals.

The result could be a focused element that cannot be blurred.

Follow up to #37125, which made
blur() apply recursively to be consistent with focus().

DiffTrain build for [278d318](278d318)
github-actions Bot pushed a commit that referenced this pull request Aug 12, 2026
focus() passes through portals as it attempts focus down the fiber tree.
blur() exited early based on a containment check, causing it to stop at
portals.

The result could be a focused element that cannot be blurred.

Follow up to #37125, which made
blur() apply recursively to be consistent with focus().

DiffTrain build for [278d318](278d318)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants