File tree Expand file tree Collapse file tree
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/view Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -305,8 +305,12 @@ public open class ReactViewGroup public constructor(context: Context?) :
305305 return false
306306 }
307307
308- // For accessibility (TalkBack), check if hover is within any child's hitSlop area
309- if (ev.isFromSource(android.view.InputDevice .SOURCE_CLASS_POINTER ) &&
308+ // For accessibility services (TalkBack), check if hover is within any child's hitSlop area.
309+ // Only apply this logic when accessibility services are enabled to avoid interfering with
310+ // other input methods (VR, mouse, stylus, etc.)
311+ val accessibilityManager = context.getSystemService(Context .ACCESSIBILITY_SERVICE ) as ? AccessibilityManager
312+ if (accessibilityManager?.isTouchExplorationEnabled == true &&
313+ ev.isFromSource(android.view.InputDevice .SOURCE_CLASS_POINTER ) &&
310314 (ev.action == MotionEvent .ACTION_HOVER_ENTER || ev.action == MotionEvent .ACTION_HOVER_MOVE )) {
311315 val x = ev.x
312316 val y = ev.y
You can’t perform that action at this time.
0 commit comments