Skip to content

Fix invisible accessibility element before scroll view#184155

Merged
auto-submit[bot] merged 5 commits into
flutter:masterfrom
LouiseHsu:list-view-a11y-fix
Apr 6, 2026
Merged

Fix invisible accessibility element before scroll view#184155
auto-submit[bot] merged 5 commits into
flutter:masterfrom
LouiseHsu:list-view-a11y-fix

Conversation

@LouiseHsu

@LouiseHsu LouiseHsu commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #164483

572928789-04153a86-5916-4402-89f1-30f07978e6ce.mov

When in VoiceOver mode, currently when focusing on a listview, it focuses on the container rather than the first element in a list. The expected behaviour is to immediately hear the first element of the list, instead of there being a silent element before it.

The fix in this pr alters the behaviour so that when VoiceOver is on, FlutterSemanticsScrollViews are not considered an accessibility element unless it has an accessibility label.

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • I followed the [breaking change policy] and added [Data Driven Fixes] where supported.
  • All existing and new tests are passing.

@LouiseHsu LouiseHsu added the CICD Run CI/CD label Mar 25, 2026
@github-actions github-actions Bot added platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Mar 25, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Mar 25, 2026
@LouiseHsu LouiseHsu added the CICD Run CI/CD label Mar 25, 2026
@github-actions github-actions Bot removed the CICD Run CI/CD label Mar 31, 2026
@LouiseHsu LouiseHsu added CICD Run CI/CD and removed CICD Run CI/CD labels Mar 31, 2026
@fluttergithubbot

This comment was marked as spam.

@github-actions github-actions Bot removed the CICD Run CI/CD label Mar 31, 2026
@LouiseHsu LouiseHsu added the CICD Run CI/CD label Mar 31, 2026
@LouiseHsu LouiseHsu marked this pull request as ready for review April 2, 2026 07:36
@LouiseHsu LouiseHsu requested a review from a team as a code owner April 2, 2026 07:36

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request modifies the accessibility behavior of scrollable objects in Flutter's iOS shell by updating the isAccessibilityElement logic to account for VoiceOver state and adding a corresponding unit test. Feedback includes a potential null pointer dereference when accessing the accessibility bridge, a concern regarding the impact of setting isAccessibilityElement to true on child node navigation, and a request to restore the explanatory comment regarding scroll actions in SwitchControl and VoiceControl.

return NO;
}

if ([self.semanticsObject bridge]->isVoiceOverRunning()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Potential null pointer dereference. [self.semanticsObject bridge] can return nil if the bridge has been destroyed while the view is still in the hierarchy. Accessing ->isVoiceOverRunning() on a null pointer will cause a crash.

Suggested change
if ([self.semanticsObject bridge]->isVoiceOverRunning()) {
flutter::AccessibilityBridgeIos* bridge = [self.semanticsObject bridge];
if (bridge && bridge->isVoiceOverRunning()) {

return ![self.semanticsObject bridge]->isVoiceOverRunning();
} else {
return NO;
return YES;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The explanatory comment for why isAccessibilityElement must return YES for SwitchControl and VoiceControl was removed. This comment provides important context for future maintainers and should be preserved.

    // In SwitchControl or VoiceControl, the isAccessibilityElement must return YES
    // in order to use scroll actions.
    return YES;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this introduce regression? @LouiseHsu

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it shouldn't, I didnt change the behaviour for anything unless voiceover is on.

@LouiseHsu LouiseHsu added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 6, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Apr 6, 2026
Merged via the queue into flutter:master with commit 6e3c87c Apr 6, 2026
190 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Apr 6, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Apr 7, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Apr 7, 2026
flutter/flutter@9cd60b5...a0924c7

2026-04-07 [email protected] Reland "[data_assets] Cleanup tests" (flutter/flutter#184714)
2026-04-07 [email protected] Use the WindowRegistry in the multiple_windows example app (flutter/flutter#184579)
2026-04-07 [email protected] Introduce command to build a swift package for SwiftPM add to app integration (flutter/flutter#184660)
2026-04-07 [email protected] Have `flutter create` create a pubspec.lock to ensure pinned versions are being used. (flutter/flutter#175352)
2026-04-07 [email protected] [widgets/raw_menu_anchor.dart] Always call onClose and onCloseRequested on descendants before parent. (flutter/flutter#182357)
2026-04-07 [email protected] `WindowsPlugin` should not crash when ffiPlugin enabled (flutter/flutter#184695)
2026-04-06 [email protected] Use full goto.google.com hostname for go/ links (flutter/flutter#184679)
2026-04-06 [email protected] Apply rect clipping to surface views (flutter/flutter#184471)
2026-04-06 [email protected] [A11y] Allow percentage strings like "50%" as `SemanticsValue` for `ProgressIndicator` (flutter/flutter#183670)
2026-04-06 [email protected] Fix invisible accessibility element before scroll view (flutter/flutter#184155)
2026-04-06 [email protected] Roll Skia from 163dfdf500c7 to e264d870a380 (2 revisions) (flutter/flutter#184674)
2026-04-06 [email protected] Keep last character obscured when toggling obscureText (flutter/flutter#183488)
2026-04-06 [email protected] Parse scheme file with XML parser for SwiftPM migrator (flutter/flutter#184525)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mbcorona pushed a commit to mbcorona/flutter that referenced this pull request Apr 15, 2026
Fixes flutter#164483


https://github.com/user-attachments/assets/87d85a46-9e62-4247-b36e-b1ff5b2e3275

When in VoiceOver mode, currently when focusing on a listview, it
focuses on the container rather than the first element in a list. The
expected behaviour is to immediately hear the first element of the list,
instead of there being a silent element before it.

The fix in this pr alters the behaviour so that when VoiceOver is on,
`FlutterSemanticsScrollView`s are not considered an accessibility
element unless it has an accessibility label.

This fix addresses this by 
## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-ios iOS applications specifically team-ios Owned by iOS platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] Extra silent accessibility focus before first ListView item

3 participants