Unverified Commit 7f12d42e authored by LongCatIsLooong's avatar LongCatIsLooong Committed by GitHub

Accessibility troubleshooting docs for TextField widgets (#103521)

parent ac333309
......@@ -200,6 +200,8 @@ class CupertinoTextField extends StatefulWidget {
/// [enableSuggestions], and [enableIMEPersonalizedLearning] properties must
/// not be null.
///
/// {@macro flutter.widgets.editableText.accessibility}
///
/// See also:
///
/// * [minLines], which is the minimum number of lines to occupy when the
......
......@@ -207,6 +207,8 @@ class _TextFieldSelectionGestureDetectorBuilder extends TextSelectionGestureDete
///
/// {@macro flutter.widgets.editableText.showCaretOnScreen}
///
/// {@macro flutter.widgets.editableText.accessibility}
///
/// See also:
///
/// * [TextFormField], which integrates with the [Form] widget.
......
......@@ -437,6 +437,30 @@ class ToolbarOptions {
/// * When the virtual keyboard pops up.
/// {@endtemplate}
///
/// {@template flutter.widgets.editableText.accessibility}
/// ## Troubleshooting Common Accessibility Issues
///
/// ### Customizing User Input Accessibility Announcements
///
/// To customize user input accessibility announcements triggered by text
/// changes, use [SemanticsService.announce] to make the desired
/// accessibility announcement.
///
/// On iOS, the on-screen keyboard may announce the most recent input
/// incorrectly when a [TextInputFormatter] inserts a thousands separator to
/// a currency value text field. The following example demonstrates how to
/// suppress the default accessibility announcements by always announcing
/// the content of the text field as a US currency value:
/// ```dart
/// onChanged: (String newText) {
/// if (newText.isNotEmpty) {
/// SemanticsService.announce('\$' + newText, Directionality.of(context));
/// }
/// }
/// ```
///
/// {@endtemplate}
///
/// See also:
///
/// * [TextField], which is a full-featured, material-design text input field
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment