mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Accessibility troubleshooting docs for TextField widgets (#103521)
This commit is contained in:
parent
ac3333094a
commit
7f12d42e2f
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user