Fix invisible accessibility element before scroll view#184155
Conversation
This comment was marked as spam.
This comment was marked as spam.
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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.
| 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; |
There was a problem hiding this comment.
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;
There was a problem hiding this comment.
I think it shouldn't, I didnt change the behaviour for anything unless voiceover is on.
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
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.
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
///).