Skip to content

[TextField] Semantics label + InputDecoration.prefixText + InputDecoration.labelText + InputDecoration.hintText Automatically Added to Voice Access Input #113457

@harperl-lgtm

Description

@harperl-lgtm

b/227994145

Steps to Reproduce

  1. Execute flutter run to run the Gallery app (https://github.com/flutter/gallery) on an Android phone
  2. Navigate to 'MATERIAL'
  3. Navigate to 'Text Field'
  4. Turn on Voice Access and use Voice Access to input to one of the Text Fields

Expected results:
Input text matches what the user said.

Actual results:
Semantics label + InputDecoration.prefixText + InputDecoration.labelText + InputDecoration.hintText gets added to user input.

Code sample
https://github.com/flutter/gallery/blob/main/lib/demos/material/text_field_demo.dart
Logs
Issue can be temporarily fixed by setting the onSetText property to an empty function in the Semantics widget here: https://github.com/flutter/flutter/blob/master/packages/flutter/lib/src/material/text_field.dart#L1453

Suspected root cause (@chunhtai): https://github.com/flutter/engine/blob/453a60f06a594834f15281cb4f29632075bb59cc/shell/platform/android/io/flutter/view/AccessibilityBridge.java#L888

Note:
'ABC' is the actual voice input, 'Name*' is InputDecoration.labelText, 'What do people call you?' is InputDecoration.hintText;
If we set InputDecoration.prefixText / add label to the Semantics widget mentioned above in TextField.dart, they will also be added to the input.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)customer: money (g3)engineflutter/engine related. See also e: labels.found in release: 3.3Found to occur in 3.3found in release: 3.5Found to occur in 3.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions