Repository navigation
Conversation
|
Found potential problems with the pull request:
|
kachmashk
force-pushed
the
fix/textinput-md3-deviations
branch
from
November 17, 2026 11:26
83b28b6 to
d781bd1
Compare
Collaborator
|
Closing in favour of #5111, which was picked up again today. |
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.
Fixes four
TextInputdeviations from MD3:onSurfaceVariantinstead ofoutline.getOutlineColortakes avariantargument, and the outlined variant keepsoutline.onSurfaceon hover. Error and disabled still win. The outerPressablereadshoveredfrom its children function.aria-describedbypoints at them, using ids fromuseId.accessibilityHint. It is no longer part ofaria-label.role="alert"instead ofaria-live="polite".label, supporting text is the accessible name.accessibilityHintis merged with the computed one instead of replacing it.TextInput.Iconwith no press handler renders a plainView+Icon. It isrole="img"with a label oraria-hiddenwithout one. It is not a button or a focus stop, and a tap still focuses the field. Icons with handlers are unchanged and needaria-label.Breaking:
Viewand ignorerestprops other thanref,testIDand the label.accessibilityRole,accessibilityLabelledByand similar props no longer apply.accessibilityHintonTextInputis now merged with the computed hint (Custom, Helper) instead of replacing it. Apps that relied on replacing the hint will hear the supporting text too.Motivation
The filled variant's colors and hover state didn't match MD3. Helper, error and counter text weren't programmatically associated with the field, so screen readers didn't read them with it. Decorative icons were focusable buttons that did nothing, which added empty stops for assistive tech.
Related issue
Takes over an older PR: fix(text-input): correct MD3 states and accessibility #5111
Test plan
iOS (VoiceOver) and Android (TalkBack)
maxLengthand check that you hear "Character limit exceeded X of Y".TextInput.Iconis skipped, or read as an image if it hasaria-label. Tapping it focuses the field.onPressis a button with its label. In a disabled field, it is announced as disabled.Web (browser plus screen reader or the accessibility inspector)
aria-describedbypointing at the helper text and the counter. Each field gets unique ids, so check with two fields on one page.role="alert".onSurface.