Skip to content

a11y: TextField with maxLength has a11y problems #38940

@andywolff

Description

@andywolff

Internal: b/140829380

If you have a text field with maxLength, such as

TextField(maxLength: 3, decoration: InputDecoration(hintText: "hint text test"))

it behaves poorly in TalkBack.

When I try to navigate to a TextField like this, it focuses only on the 0/3 character count, skipping the input field. The character count reads nicely, announcing "3 characters remaining", but the hintText is not read and it does not indicate that a text field is in focus and can be interacted with. If you double-tap now, it will open the keyboard, but the TalkBack outline is still around the 0/3. I guess this is in some kind of bad initial state.

Now, type some text. When you type the 4th character and exceed the limit, it correctly does not add the character, but it just reads "Showing English (US)(QUERTY) keyboard". I would expect it to provide some indication that the 4th character has been rejected, like "no characters remaining".

Now navigate backwards and then forwards again. Now that the text field has text in it, it reads "Editing, xxx, hint text test, edit box". You can then navigate forwards again to focus on the 3/3, which will properly read "No characters remaining".

If you delete all of the input text, it does not go back into the bad initial state where the screen reader does not see the input field.

Metadata

Metadata

Assignees

Labels

a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions