Skip to content

[Android] static text components are picked keyboard navigation due to having userSelect = "auto" style by default #314

@mdjastrzebski

Description

@mdjastrzebski

Describe the issue

h.span and other text components default to userSelect: "auto" style. This causes keyboard navigation (tab or dpad) to pick default text elements as focusable.

CleanShot.2025-06-09.at.11.57.00.mp4

React Native's Text behaves correctly (is skipped by keyboard nav).

How this happens:

  • this starts with default style of userSelect: "auto" here
  • which causes selectable: true prop passed to React Native component here
  • then this sets textIsSelectable attribute on ReactTextView which is descendant of Android TextView here
  • finally Android's TextView sets couple of flags: focusable, focusableInTouchMode, clickable, and longClickable to true docs

Since React Native is not exposing any of the focusable, etc flags, this cannot be overridden, to make text non-focusable.

NOTE:

  • this is different from screen reader behavior when it's expected that text elements are picked up, this issue is for keyboard navigation.
  • on iOS these default text components behave correctly
  • on iOS these default text components aren't do not have "selectable" text but rather enable Copy context action

Expected behavior

Default text components should not be picked by keyboard/dpad navigation.

IMO reasonable solution would be to have default to userSelect: none for native environments (iOS, Android), as this matches the default behavior on both OSes.

Steps to reproduce

  1. In Android emulator run the test case repo
  2. Use Tab key (or dpad) to cycle through elements

Test case

https://github.com/mdjastrzebski/repro-rsd-keyboard-navigation

Additional comments

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions