Skip to content

fix: register click/change/submit listeners in capture phase - Needed for RN Web - #586

Open
tylerjroach wants to merge 1 commit into
masterfrom
fix/autocapture-capture-phase-listeners
Open

fix: register click/change/submit listeners in capture phase - Needed for RN Web#586
tylerjroach wants to merge 1 commit into
masterfrom
fix/autocapture-capture-phase-listeners

Conversation

@tylerjroach

@tylerjroach tylerjroach commented May 14, 2026

Copy link
Copy Markdown
Contributor

Registers click/change/submit listeners in capture phase

Bubble-phase listeners on window are silenced when downstream component
code calls event.stopPropagation(). React Native Web's PressResponder
does this unconditionally on every onClick, breaking autocapture for
all RNW-rendered components. Capture-phase listeners fire before any
component handler runs, so stopPropagation() in bubble cannot reach them.

Applied to all five user-interaction listeners: click, dead-click,
rage-click, input change, and form submit. Matching removeEventListener
calls also updated since browsers treat capture and bubble registrations
as separate.

…hase

Bubble-phase listeners on window are silenced when downstream component
code calls event.stopPropagation(). React Native Web's PressResponder
does this unconditionally on every onClick, breaking autocapture for
all RNW-rendered components. Capture-phase listeners fire before any
component handler runs, so stopPropagation() in bubble cannot reach them.

Applied to all five user-interaction listeners: click, dead-click,
rage-click, input change, and form submit. Matching removeEventListener
calls also updated since browsers treat capture and bubble registrations
as separate.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@tylerjroach tylerjroach changed the title fix(autocapture): register click/change/submit listeners in capture phase May 14, 2026

@jakewski jakewski left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks will get this in next release

jakewski pushed a commit that referenced this pull request May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants