[SuperTextField][accessibility] Add semantic support#2908
Open
aaguueeroo wants to merge 1 commit into
Open
Conversation
- Wrap SuperTextField implementations with Semantics widget - Add textField, focusable, focused, and value properties - Improves screen reader support across all platforms (iOS, Android, Desktop) - Addresses accessibility gap compared to Flutter's native TextField Changes: - SuperDesktopTextField: Added Semantics wrapper to build method - SuperAndroidTextField: Added Semantics wrapper to build method - SuperIOSTextField: Added Semantics wrapper to build method This change ensures SuperTextField is properly announced by screen readers, making it accessible to users with visual impairments. The implementation mirrors Flutter's native TextField semantics behavior, providing: - Text field identification (textField: true) - Focusable state (focusable: true) - Current focus state (focused: focusNode.hasFocus) - Current text value (value: text.toPlainText()) All existing tests pass without modification.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
SuperTextFieldcurrently lacks semantic properties, making it inaccessible to screen reader users. Unlike Flutter's nativeTextFieldwhich has built-in semantics,SuperTextFielduses custom rendering viaSuperTextand provides no accessibility information to assistive technologies.Solution
This PR adds
Semanticswrapper to all three platform implementations ofSuperTextField:SuperDesktopTextFieldSuperAndroidTextFieldSuperIOSTextFieldThe following semantic properties are now exposed:
textField: true- Identifies the widget as a text input fieldfocusable: true- Indicates the field can receive focusfocused- Reports current focus statevalue- Announces current text content to screen readersTesting
Impact
Comparison with Flutter TextField
This brings
SuperTextFieldto parity with Flutter's nativeTextFieldin terms of accessibility support, as required by WCAG 2.1 guidelines.