Skip to content

[SuperTextField][accessibility] Add semantic support#2908

Open
aaguueeroo wants to merge 1 commit into
Flutter-Bounty-Hunters:mainfrom
superlistapp:feature/add-semantics-support
Open

[SuperTextField][accessibility] Add semantic support#2908
aaguueeroo wants to merge 1 commit into
Flutter-Bounty-Hunters:mainfrom
superlistapp:feature/add-semantics-support

Conversation

@aaguueeroo
Copy link
Copy Markdown

Problem

SuperTextField currently lacks semantic properties, making it inaccessible to screen reader users. Unlike Flutter's native TextField which has built-in semantics, SuperTextField uses custom rendering via SuperText and provides no accessibility information to assistive technologies.

Solution

This PR adds Semantics wrapper to all three platform implementations of SuperTextField:

  • SuperDesktopTextField
  • SuperAndroidTextField
  • SuperIOSTextField

The following semantic properties are now exposed:

  • textField: true - Identifies the widget as a text input field
  • focusable: true - Indicates the field can receive focus
  • focused - Reports current focus state
  • value - Announces current text content to screen readers

Testing

  • All existing tests pass
  • Widget tree structure remains unchanged

Impact

  • Breaking Change: No
  • API Changes: No
  • Behavior: Screen readers can now properly identify and read SuperTextField content

Comparison with Flutter TextField

This brings SuperTextField to parity with Flutter's native TextField in terms of accessibility support, as required by WCAG 2.1 guidelines.

- 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.
@aaguueeroo aaguueeroo changed the title feat: Add semantic support to SuperTextField for accessibility [feat][accessibility] Add semantic support to SuperTextField Jan 29, 2026
@aaguueeroo aaguueeroo changed the title [feat][accessibility] Add semantic support to SuperTextField [accessibility][SuperTextField] Add semantic support Jan 30, 2026
@aaguueeroo aaguueeroo changed the title [accessibility][SuperTextField] Add semantic support [SuperTextField][accessibility] Add semantic support Jan 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant