Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hint text semantics to be excluded in a11y read out if textfield in not empty and label text is provided #114511

Closed
stellaseahll opened this issue Nov 2, 2022 · 5 comments
Assignees
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: text input Entering text in a text field or keyboard related problems customer: google Various Google teams customer: money (g3) f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P0 Critical issues such as a build break or regression

Comments

@stellaseahll
Copy link

stellaseahll commented Nov 2, 2022

Internal: b/258261921

Currently, hint text can either be used to (1) provide hint text for users, or (2) as a label for the text field.
E.g. to enter phone number, hint text can be either (1) 0000 - 0000 or (2) Phone number.

For a11y users, the hint text is always read regardless of use case (1) or (2) and this is problematic for use case (1).

E.g. when the text field is filled with 1234 - 5678, it reads both the text and hint text "1234 - 5678, 0000 - 0000"

Can we tweak the current feature to exclude the hint from a11y if the textfield is not empty AND a dedicated label text is given?

@goderbauer goderbauer added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) customer: google Various Google teams P2 labels Nov 2, 2022
@goderbauer
Copy link
Member

Internal bug for this is b/255727805

/cc @justinmc @chunhtai

Can we tweak the current feature to exclude the hint from a11y if the textfield is not empty AND a dedicated label text is given?

This sounds reasonable to me as long as the hint is included if there is no explicit label given because some app designs use the hint as a label in that case and we don't want to loose that information there.

@chunhtai
Copy link
Contributor

chunhtai commented Nov 2, 2022

This sounds reasonable we should exclude the hintext if there is text in the textfield.

@goderbauer
Copy link
Member

goderbauer commented Nov 2, 2022

This sounds reasonable we should exclude the hintext if there is text in the textfield.

Only if there is a separate label text, though. Otherwise, the hint is likely the label.

@chunhtai
Copy link
Contributor

chunhtai commented Nov 2, 2022

Should be a one line fix

alwaysIncludeSemantics: true,

@hangyujin can you take a look at this?

@hangyujin hangyujin changed the title Hint text semantics to be excluded in a11y read out if label text is not provided Hint text semantics to be excluded in a11y read out if textfield in not empty and label text is provided Nov 9, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2022
@flutter-triage-bot flutter-triage-bot bot added P0 Critical issues such as a build break or regression and removed P2 labels Jun 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) a: text input Entering text in a text field or keyboard related problems customer: google Various Google teams customer: money (g3) f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. P0 Critical issues such as a build break or regression
Projects
None yet
Development

No branches or pull requests

4 participants