Skip to content

[react-dom] Add support for onFullscreenChange and onFullscreenError events#150

Closed
everettbu wants to merge 2 commits into
mainfrom
fullscreen-events
Closed

[react-dom] Add support for onFullscreenChange and onFullscreenError events#150
everettbu wants to merge 2 commits into
mainfrom
fullscreen-events

Conversation

@everettbu

@everettbu everettbu commented Dec 12, 2025

Copy link
Copy Markdown

Mirror of facebook/react#34621
Original author: chirokas


Summary

This adds support for the fullscreenchange and fullscreenerror events.

These events are currently supported in Chrome and Firefox(see browser compatibility table). You can read more about these events here.


https://github.com/facebook/react/blob/2622487a7495b2ded000e1ad8b2e292d01bdd126/packages/react-dom-bindings/src/events/ReactDOMEventListener.js#L364-L366

I omit fullscreenerror here so it falls back to default below.

How did you test this change?

Added unit tests.

@greptile-apps

greptile-apps Bot commented Dec 12, 2025

Copy link
Copy Markdown

Greptile Summary

This PR adds support for the onFullscreenChange and onFullscreenError React event handlers, mirroring facebook/react#34621. These map to the native fullscreenchange and fullscreenerror DOM events.

  • Adds fullscreenerror to the DOMEventName Flow type union (alongside the pre-existing fullscreenchange)
  • Registers both fullscreenChange and fullscreenError as simple events in DOMEventProperties.js, enabling onFullscreenChange and onFullscreenError React props
  • Assigns fullscreenerror discrete event priority, matching fullscreenchange
  • Adds unit tests for both events using the testNativeBubblingEvent pattern

Confidence Score: 5/5

  • This PR is safe to merge — it follows established patterns for adding new DOM event support with no risk to existing functionality.
  • The changes are minimal and formulaic, following the exact same pattern used by every other simple event in the React DOM event system. The naming conventions are correct (verified by tracing through registerSimpleEvents), the event priority classification is appropriate, the Flow types are complete, and unit tests are included. No existing behavior is modified.
  • No files require special attention.

Important Files Changed

Filename Overview
packages/react-dom-bindings/src/events/DOMEventNames.js Adds 'fullscreenerror' to the DOMEventName Flow type union, correctly placed in alphabetical order alongside the existing 'fullscreenchange' entry.
packages/react-dom-bindings/src/events/DOMEventProperties.js Adds 'fullscreenChange' and 'fullscreenError' to the simpleEventPluginEvents array, which registers the onFullscreenChange and onFullscreenError React event handlers. The camelCase naming follows the established convention and correctly maps to lowercase DOM event names via registerSimpleEvents().
packages/react-dom-bindings/src/events/ReactDOMEventListener.js Adds 'fullscreenerror' to the discrete event priority switch case, alongside the existing 'fullscreenchange' entry. Discrete priority is appropriate for this user-initiated event.
packages/react-dom/src/tests/ReactDOMEventPropagation-test.js Adds unit tests for both onFullscreenChange and onFullscreenError using the testNativeBubblingEvent helper. Tests correctly set bubbles: true and cancelable: false matching the actual DOM event spec.

Last reviewed commit: ac58801

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@everettbu everettbu added the Resolution: Stale Automatically closed due to inactivity label Feb 16, 2026
@everettbu everettbu changed the title React DOM: Add support for onFullscreenChange and onFullscreenError events [react-dom] Add support for onFullscreenChange and onFullscreenError events Feb 18, 2026
@everettbu everettbu removed the Resolution: Stale Automatically closed due to inactivity label Feb 18, 2026

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@everettbu

Copy link
Copy Markdown
Author

Upstream PR was closed or merged. Code is synced via branch mirror.

@everettbu everettbu closed this Feb 18, 2026
@everettbu
everettbu deleted the fullscreen-events branch February 18, 2026 01:47
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