Repository navigation
Conversation
|
@cortinico has exported this pull request. If you are a Meta employee, you can view the originating Diff in D131164392. |
cortinico
added a commit
to cortinico/react-native
that referenced
this pull request
Nov 13, 2026
…ts are enabled (react#59992) Summary: When `ReactFeatureFlags.dispatchPointerEvents` is enabled, `ReactViewGroup.onHoverEvent` returned `canBeTouchTarget(pointerEvents)` without calling `View.onHoverEvent`, so React Native views never sent `TYPE_VIEW_HOVER_ENTER`/`EXIT` accessibility events. Hover-driven accessibility services (for example hover text-to-speech) were silent over the body of a pressable view, while its plain text and image children, which don't override `onHoverEvent`, still spoke. Just calling `super.onHoverEvent` is not enough: a pressable often contains a full-size `pointerEvents="none"` overlay child, and `View.onHoverEvent` skips accessibility hover while any child is hovered. This change makes `ReactViewGroup` send hover enter/exit itself, from its nearest important-for-accessibility ancestor, when it can be a touch target. It stays silent while a child that can take the hover is under the pointer. `pointerEvents="none"` children are ignored and `box-none` children are checked one level deeper. The view remembers which view received HOVER_ENTER and sends the matching HOVER_EXIT to that same view, so enter/exit stay paired even if no ancestor was important for accessibility at enter time or the important ancestor changes mid-hover. A pending HOVER_EXIT is also sent when the view is recycled or detached from the window mid-hover. Behavior with pointer events disabled is unchanged. Note for reviewers: a plain hovered container now emits hover enter/exit the way stock Android does with the flag off. Changelog: [Android][Fixed] - Send accessibility hover events from `ReactViewGroup` when pointer events dispatch is enabled Differential Revision: D131164392
cortinico
force-pushed
the
export-D131164392
branch
from
November 13, 2026 13:32
9e94589 to
5d73bf0
Compare
…ts are enabled (react#59992) Summary: When `ReactFeatureFlags.dispatchPointerEvents` is enabled, `ReactViewGroup.onHoverEvent` returned `canBeTouchTarget(pointerEvents)` without calling `View.onHoverEvent`, so React Native views never sent `TYPE_VIEW_HOVER_ENTER`/`EXIT` accessibility events. Hover-driven accessibility services (for example hover text-to-speech) were silent over the body of a pressable view, while its plain text and image children, which don't override `onHoverEvent`, still spoke. Just calling `super.onHoverEvent` is not enough: a pressable often contains a full-size `pointerEvents="none"` overlay child, and `View.onHoverEvent` skips accessibility hover while any child is hovered. This change makes `ReactViewGroup` send hover enter/exit itself, from its nearest important-for-accessibility ancestor, when it can be a touch target. It stays silent while a child that can take the hover is under the pointer. `pointerEvents="none"` children are ignored and `box-none` children are checked one level deeper. The view remembers which view received HOVER_ENTER and sends the matching HOVER_EXIT to that same view, so enter/exit stay paired even if no ancestor was important for accessibility at enter time or the important ancestor changes mid-hover. A pending HOVER_EXIT is also sent when the view is recycled or detached from the window mid-hover. Behavior with pointer events disabled is unchanged. Note for reviewers: a plain hovered container now emits hover enter/exit the way stock Android does with the flag off. Changelog: [Android][Fixed] - Send accessibility hover events from `ReactViewGroup` when pointer events dispatch is enabled Differential Revision: D131164392
cortinico
force-pushed
the
export-D131164392
branch
from
November 13, 2026 13:41
5d73bf0 to
a9b2ac4
Compare
Visual regressionNo visual differences at ios: no capture |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
When
ReactFeatureFlags.dispatchPointerEventsis enabled,ReactViewGroup.onHoverEventreturnedcanBeTouchTarget(pointerEvents)without callingView.onHoverEvent, so React Native views never sentTYPE_VIEW_HOVER_ENTER/EXITaccessibility events. Hover-driven accessibility services (for example hover text-to-speech) were silent over the body of a pressable view, while its plain text and image children, which don't overrideonHoverEvent, still spoke.Just calling
super.onHoverEventis not enough: a pressable often contains a full-sizepointerEvents="none"overlay child, andView.onHoverEventskips accessibility hover while any child is hovered. This change makesReactViewGroupsend hover enter/exit itself, from its nearest important-for-accessibility ancestor, when it can be a touch target. It stays silent while a child that can take the hover is under the pointer.pointerEvents="none"children are ignored andbox-nonechildren are checked one level deeper. The view remembers which view received HOVER_ENTER and sends the matching HOVER_EXIT to that same view, so enter/exit stay paired even if no ancestor was important for accessibility at enter time or the important ancestor changes mid-hover. A pending HOVER_EXIT is also sent when the view is recycled or detached from the window mid-hover. Behavior with pointer events disabled is unchanged.Note for reviewers: a plain hovered container now emits hover enter/exit the way stock Android does with the flag off.
Changelog: [Android][Fixed] - Send accessibility hover events from
ReactViewGroupwhen pointer events dispatch is enabledDifferential Revision: D131164392