Skip to content

Commit 70b0f77

Browse files
authored
fix: Text input Incorrect reading order and trailing action (#449) (#450) (#451)
* fix: reorder the reading * fix: exclude prefix icon role, add trailing icon button role and description * review: accessibility * chore: update labels
1 parent ab45ea7 commit 70b0f77

16 files changed

Lines changed: 235 additions & 173 deletions

app/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1818
- [Tool] Change the favicon to orange favicon in the documentation ([#371](https://github.com/Orange-OpenSource/ouds-flutter/issues/371))
1919

2020
### Fixed
21+
- [DemoApp][Library] `Text input` Trailing action button should have its own accessibility label ([#450](https://github.com/Orange-OpenSource/ouds-flutter/issues/450))
22+
- [Library] `Text input` Incorrect reading order ([#449](https://github.com/Orange-OpenSource/ouds-flutter/issues/449))
2123
- [DemoApp] Android The native tab-bar is displayed on top of the customize bottom sheet ([#358](https://github.com/Orange-OpenSource/ouds-flutter/issues/358))
2224
- [Library] `Checkbox item` + icon : wrong accessible name ([#392](https://github.com/Orange-OpenSource/ouds-flutter/issues/392))
2325
- [Library] `Checkbox`: hint is missing on component ([#327](https://github.com/Orange-OpenSource/ouds-flutter/issues/391))

app/lib/l10n/gen/ouds_flutter_app_localizations.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,12 @@ abstract class AppLocalizations {
842842
/// **'This field can’t be empty.'**
843843
String get app_components_text_input_error_label;
844844

845+
/// No description provided for @app_components_textInput_trailingIcon_a11y.
846+
///
847+
/// In en, this message translates to:
848+
/// **'Trailing icon content description'**
849+
String get app_components_textInput_trailingIcon_a11y;
850+
845851
/// No description provided for @app_components_link_label.
846852
///
847853
/// In en, this message translates to:

app/lib/l10n/gen/ouds_flutter_app_localizations_ar.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ class AppLocalizationsAr extends AppLocalizations {
406406
String get app_components_text_input_error_label =>
407407
'لا يمكن أن يكون هذا الحقل فارغًا.';
408408

409+
@override
410+
String get app_components_textInput_trailingIcon_a11y =>
411+
'وصف محتوى أيقونة النهاية';
412+
409413
@override
410414
String get app_components_link_label => 'رابط';
411415

app/lib/l10n/gen/ouds_flutter_app_localizations_en.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ class AppLocalizationsEn extends AppLocalizations {
406406
String get app_components_text_input_error_label =>
407407
'This field can’t be empty.';
408408

409+
@override
410+
String get app_components_textInput_trailingIcon_a11y =>
411+
'Trailing icon content description';
412+
409413
@override
410414
String get app_components_link_label => 'Link';
411415

app/lib/l10n/ouds_flutter_ar.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@
155155
"app_components_text_input_placeholder_label": "العنصر النائب",
156156
"app_components_text_input_helperText_label": "نص مساعد",
157157
"app_components_text_input_error_label": "لا يمكن أن يكون هذا الحقل فارغًا.",
158+
"app_components_textInput_trailingIcon_a11y": "وصف محتوى أيقونة النهاية",
158159

159160
"@_components_link": {},
160161
"app_components_link_label": "رابط",

app/lib/l10n/ouds_flutter_en.arb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@
191191
"app_components_text_input_placeholder_label": "Placeholder",
192192
"app_components_text_input_helperText_label": "Helper text",
193193
"app_components_text_input_error_label": "This field can’t be empty.",
194+
"app_components_textInput_trailingIcon_a11y": "Trailing icon content description",
194195

195196
"@_components_link": {},
196197
"app_components_link_label": "Link",

app/lib/ui/components/text_input/text_input_demo_screen.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ class _TextInputDemoState extends State<_TextInputDemo> {
146146
focusNode: textInputFocus,
147147
enabled: customizationState.hasEnabled,
148148
readOnly: customizationState.hasReadOnly,
149+
trailingIconContentDescription: context.l10n.app_components_textInput_trailingIcon_a11y,
149150
decoration: OudsInputDecoration(
150151
labelText: customizationState.labelText.isNotEmpty ? TextInputCustomizationUtils.getLabelText(customizationState) : null,
151152
helperText: customizationState.helperText.isNotEmpty ? TextInputCustomizationUtils.getHelperText(customizationState) : null,
@@ -173,6 +174,7 @@ class _TextInputDemoState extends State<_TextInputDemo> {
173174
focusNode: textInputFocus,
174175
enabled: customizationState.hasEnabled,
175176
readOnly: customizationState.hasReadOnly,
177+
trailingIconContentDescription: context.l10n.app_components_textInput_trailingIcon_a11y,
176178
decoration: OudsInputDecoration(
177179
labelText: customizationState.labelText.isNotEmpty ? TextInputCustomizationUtils.getLabelText(customizationState) : null,
178180
helperText: customizationState.helperText.isNotEmpty ? TextInputCustomizationUtils.getHelperText(customizationState) : null,

ouds_core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
- [Tool] Change the favicon to orange favicon in the documentation ([#371](https://github.com/Orange-OpenSource/ouds-flutter/issues/371))
1717

1818
### Fixed
19+
- [Library] `Text input` Trailing action button should have its own accessibility label ([#450](https://github.com/Orange-OpenSource/ouds-flutter/issues/450))
20+
- [Library] `Text input` Incorrect reading order ([#449](https://github.com/Orange-OpenSource/ouds-flutter/issues/449))
1921
- [Library] `Checkbox item` + icon : wrong accessible name ([#392](https://github.com/Orange-OpenSource/ouds-flutter/issues/392))
2022
- [Library] `Checkbox`: hint is missing on component ([#327](https://github.com/Orange-OpenSource/ouds-flutter/issues/391))
2123
- [Library] Android `Switch` : remove the useless focus on switch ([#327](https://github.com/Orange-OpenSource/ouds-flutter/issues/364))

ouds_core/lib/components/button/ouds_button.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class _OudsButtonState extends State<OudsButton> {
203203
switch (buttonState) {
204204
case OudsButtonControlState.loading:
205205
return Semantics(
206-
label: OudsLocalizations.of(context)?.core_button_loading_a11y,
206+
label: OudsLocalizations.of(context)?.core_common_loading_a11y,
207207
enabled: false,
208208
button: true,
209209
child: ExcludeSemantics(
@@ -294,7 +294,7 @@ class _OudsButtonState extends State<OudsButton> {
294294
switch (buttonState) {
295295
case OudsButtonControlState.loading:
296296
return Semantics(
297-
label: OudsLocalizations.of(context)?.core_button_loading_a11y,
297+
label: OudsLocalizations.of(context)?.core_common_loading_a11y,
298298
enabled: false,
299299
button: true,
300300
child: IconButton(
@@ -343,7 +343,7 @@ class _OudsButtonState extends State<OudsButton> {
343343
switch (buttonState) {
344344
case OudsButtonControlState.loading:
345345
return Semantics(
346-
label: OudsLocalizations.of(context)?.core_button_loading_a11y,
346+
label: OudsLocalizations.of(context)?.core_common_loading_a11y,
347347
enabled: false,
348348
button: true,
349349
child: ExcludeSemantics(

ouds_core/lib/components/tag/ouds_tag.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class _OudsTagState extends State<OudsTag> {
195195
width: widthAndHeightAssetsContainer[OudsTagDimensions.width.name],
196196
height: widthAndHeightAssetsContainer[OudsTagDimensions.height.name],
197197
child: Semantics(
198-
label: l10n?.core_tag_loading_a11y,
198+
label: l10n?.core_common_loading_a11y,
199199
child: CircularProgressIndicator(
200200
padding: tagSizeModifier.getAssetsPadding(widget.size, OudsTagLayout.textAndLoader),
201201
color: tagStatusModifier.getStatusTextAndLoaderColor(widget.status, widget.hierarchy),

0 commit comments

Comments
 (0)