Skip to content

fix(text-input): keep the hidden placeholder empty - #5199

Merged
Doberjohn merged 1 commit into
callstack:mainfrom
datsiuk-ck:fix/textinput-a11y-resting-label
Nov 23, 2026
Merged

Doberjohn merged 1 commit into
callstack:mainfrom
datsiuk-ck:fix/textinput-a11y-resting-label

Conversation

@datsiuk-ck

@datsiuk-ck datsiuk-ck commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

After #5111 an empty labelled TextInput is reachable again, but its hidden placeholder is ' ', and a blank is read as the field's text: TalkBack says "Space, Edit box", not the label, and iOS reports a blank value. The hidden placeholder is now empty; only iOS multiline keeps ' ' (react/react-native#31573).

Related issue

Follows #5111 (#5197).

Screenshots / Videos

Before After
TalkBack
iOS

Test plan

On an empty <TextInput label="Email" placeholder="[email protected]" />: TalkBack reads "Email, Edit box"; focusing shows the placeholder once the label floats.

@github-actions

Copy link
Copy Markdown

Found potential problems with the pull request:

  • The description is too long. Please keep it under 1000 characters.

@Doberjohn Doberjohn added this to the 6.0.0 milestone Nov 10, 2026
@Doberjohn Doberjohn assigned Doberjohn and datsiuk-ck and unassigned Doberjohn Nov 17, 2026
@Doberjohn

Copy link
Copy Markdown
Collaborator

/review

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of a891e95

No open findings.

2 findings below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (677ab9f2b2cf).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@Doberjohn Doberjohn 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, the fix works on iOS, Android and web. Two things show up only with this change: a flash on focus (inline), and on Android the floating label reads "Labe" for about 0.7 s. Could you also trim the description under 1000 characters?

Comment thread src/components/TextInput/hooks.ts Resolved
@datsiuk-ck
datsiuk-ck force-pushed the fix/textinput-a11y-resting-label branch from a891e95 to 4dcd88c Compare November 19, 2026 23:09
While the label rests over an empty field, the placeholder was ' '. A
blank is read as the field's text: TalkBack announced an empty "Email"
field as "Space, edit box" and dropped its label, and iOS reported the
blank as the field's value. The hidden placeholder is now empty. Only iOS
multiline fields keep ' ', which keeps their placeholder updating
(react-native#31573), the reason the space was added.

Follows callstack#5111, which made the empty field reachable (callstack#5197).
@datsiuk-ck
datsiuk-ck force-pushed the fix/textinput-a11y-resting-label branch from 4dcd88c to 438fda5 Compare November 20, 2026 00:20
@datsiuk-ck datsiuk-ck changed the title fix(text-input): expose an empty labelled TextInput to screen readers fix(text-input): keep the hidden placeholder empty Nov 20, 2026
@datsiuk-ck
datsiuk-ck requested a review from Doberjohn November 20, 2026 00:48
@datsiuk-ck

Copy link
Copy Markdown
Contributor Author

Rebased on #5111, which fixed the reachability part of #5197, so this PR is now only the hidden placeholder: TalkBack still read the ' ' as “Space” instead of the label.

I couldn’t reproduce the “Labe” label on Android after the rebase (it shows in full in every frame), so it likely came from the removed opacity change.

Description is now under 1000 characters.

@Doberjohn
Doberjohn merged commit fbf9006 into callstack:main Nov 23, 2026
12 checks passed
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