flutter
flutter copied to clipboard
a11y: disabled textfield not announced as textfield
TextField(
enabled: false,
),
On Android with TalkBack enabled this should be announced as a disabled editbox. It is currently not announced at all. (It looks like the TextField flag is missing from the semantics tree when the TextField is disabled).
I haven't tested on iOS (and I am not 100% of what the native behavior is there), but I assume it's also broken there.
/cc @dnfield for a11y /cc @chunhtai @justinmc for TextFields
TextField wraps an EditableText within an IgnorePointer:
https://github.com/flutter/flutter/blob/24f483cf25aab43a389a64f15bf9cc1aee130f47/packages/flutter/lib/src/material/text_field.dart#L1026
RenderIgnorePointer has the following TODO:
https://github.com/flutter/flutter/blob/24f483cf25aab43a389a64f15bf9cc1aee130f47/packages/flutter/lib/src/rendering/proxy_box.dart#L2975-L2982
Which is probably to blame here. When the textfield is disabled, IgnorePointer is enabled and all semantics from EditableText (like isTextField, etc) is no longer included in the tree.
I tried on iOS with VoiceOver enabled and you're right that it's also broken there. For an enabled CupertinoTextField, it's announced correctly as "text field", and for a disabled CupertinoTextField, it's not announced at all.
Hi @justinmc @goderbauer and probably @Hixie, Can you take a look at my prototype pr? https://github.com/flutter/flutter/pull/37199
design doc https://docs.google.com/document/d/1WuVBc58_wV6__ZCe1NgYsnvTJtSdOtVcwSzPwM_YT74/edit?usp=sharing
Is this still being actively worked on? If we have addressed it, please close the bug.
No, I have a draft up, but I has been distracted due to other higher priority issues. This is currently sitting in my back log, and i don't think i can get to it in the near future. Has the priority of this issue shifted?
@chunhtai no change on priority. I am simply triaging old issues and noticed this one.
https://github.com/flutter/flutter/issues/59402 related
@goderbauer The input decorator can take in prefix and suffix widget that can respond to pointer event, but is it something we should worry about in this case? If it is the user passes in the widget, should the textfield disable the gesture on that widget?
What's today's behavior when you do that and disable the text field?
I just tested. the whole thing is excluded from semantics, including the suffix button. The IgnorePointer is wrapping everything in the textfield.
flutter doctor -v
[✓] Flutter (Channel dev, 1.20.0-7.1.pre, on Mac OS X 10.15.6 19G73, locale
en-GB)
• Flutter version 1.20.0-7.1.pre at /Users/taha/Code/flutter_dev
• Framework revision 7736f3bc90 (6 days ago), 2020-07-10 16:33:05 -0700
• Engine revision d48085141c
• Dart version 2.9.0 (build 2.9.0-21.2.beta)
[✓] Android toolchain - develop for Android devices (Android SDK version
30.0.0)
• Android SDK at /Users/taha/Code/sdk
• Platform android-30, build-tools 30.0.0
• ANDROID_HOME = /Users/taha/Code/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google
Chrome
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 47.1.2
• Dart plugin version 193.7361
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.47.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.12.2
[✓] Connected device (5 available)
• SM M305F (mobile) • 32003c30dc19668f • android-arm64 •
Android 10 (API 29)
• Taha’s iPhone (mobile) • 00008020-001059882212002E • ios •
iOS 13.6
• macOS (desktop) • macos • darwin-x64 •
Mac OS X 10.15.6 19G73
• Web Server (web) • web-server • web-javascript •
Flutter Tools
• Chrome (web) • chrome • web-javascript •
Google Chrome 83.0.4103.116
• No issues found!
Verified this on latest versions and confirmed the behavior is still replicable. Talkback / voiceover doesn't announce / read disabled textfield.
stable, master flutter doctor -v
[✓] Flutter (Channel stable, 3.3.7, on macOS 12.2.1 21D62 darwin-x64, locale
en-GB)
• Flutter version 3.3.7 on channel stable at
/Users/dhs/documents/fluttersdk/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e99c9c7cd9 (2 days ago), 2022-11-01 16:59:00 -0700
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[!] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
! Flutter recommends a minimum Xcode version of 13.
Download the latest version or update via the Mac App Store.
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] VS Code (version 1.62.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.21.0
[✓] Connected device (5 available)
• SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30)
• Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 •
ios • iOS 14.4.1 18D61
• iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 •
ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
• macOS (desktop) • macos •
darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64
• Chrome (web) • chrome •
web-javascript • Google Chrome 98.0.4758.80
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
[!] Flutter (Channel master, 3.5.0-12.0.pre.175, on macOS 12.2.1 21D62
darwin-x64, locale en-GB)
• Flutter version 3.5.0-12.0.pre.175 on channel master at
/Users/dhs/documents/fluttersdk/flutter
! Warning: `flutter` on your path resolves to
/Users/dhs/Documents/Fluttersdk/flutter/bin/flutter, which is not inside
your current Flutter SDK checkout at
/Users/dhs/documents/fluttersdk/flutter. Consider adding
/Users/dhs/documents/fluttersdk/flutter/bin to the front of your path.
! Warning: `dart` on your path resolves to
/Users/dhs/Documents/Fluttersdk/flutter/bin/dart, which is not inside your
current Flutter SDK checkout at /Users/dhs/documents/fluttersdk/flutter.
Consider adding /Users/dhs/documents/fluttersdk/flutter/bin to the front
of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 92f10ed712 (3 hours ago), 2022-11-08 17:57:52 -0800
• Engine revision e7d7edab98
• Dart version 2.19.0 (build 2.19.0-374.0.dev)
• DevTools version 2.19.0
• If those were intentional, you can disregard the above warnings; however
it is recommended to use "git" directly to perform update checks and
upgrades.
[!] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
! Flutter recommends a minimum Xcode version of 13.
Download the latest version or update via the Mac App Store.
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] VS Code (version 1.62.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.21.0
[✓] Connected device (5 available)
• SM G975F (mobile) • RZ8M802WY0X • android-arm64 • Android 11 (API 30)
• Darshan's iphone (mobile) • 21150b119064aecc249dfcfe05e259197461ce23 •
ios • iOS 14.4.1 18D61
• iPhone 12 Pro Max (mobile) • A5473606-0213-4FD8-BA16-553433949729 •
ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
• macOS (desktop) • macos •
darwin-x64 • Mac OS X 10.15.4 19E2269 darwin-x64
• Chrome (web) • chrome •
web-javascript • Google Chrome 98.0.4758.80
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 1 category.
Verified this on the latest versions and it is replicable but not fixed yet, for android it read disabled, and for iOS, it read dimmed not with the text field or edit box.
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.