Skip to content

[a11y] Fixes SnackBar showing more Voice Control labels than expected - #194614

Merged
auto-submit[bot] merged 3 commits into
flutter:masterfrom
LouiseHsu:a11y-ios-snackbar-voice-control
Oct 24, 2026
Merged

auto-submit[bot] merged 3 commits into
flutter:masterfrom
LouiseHsu:a11y-ios-snackbar-voice-control

Conversation

@LouiseHsu

Copy link
Copy Markdown
Contributor

Fixes #157630

SnackBar incorrectly had an VoiceControl label attributed to it, because SnackBar technically has 3 actions attributed to it - kDismiss, kScrollUp, and kScrollDown.

In this PR I exclude kDismiss and kScrollUp/Down/Left/Right from ever receiving VoiceOver labels.

  • kDismiss: only maps to Escape, not Tap. It's only used in accessibilityPerformEscape, which is the VoiceOver 2 finger Z-scrub or verbal "Go back" command.
  • kScrollUp/Down/Left/Right: Scrollables are rendered as a native UIScrollView, not as an SemanticsObject, so shouldn't receive a VoiceControl label.
image

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 in-code documentation (doc comments with ///).
  • If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed).
  • 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.

@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 Oct 17, 2026
@LouiseHsu LouiseHsu added CICD Run CI/CD and removed platform-ios iOS applications specifically engine flutter/engine related. See also e: labels. team-ios Owned by iOS platform team labels Oct 17, 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 Oct 17, 2026
@LouiseHsu
LouiseHsu marked this pull request as ready for review October 19, 2026 22:02
@LouiseHsu
LouiseHsu requested a review from a team as a code owner October 19, 2026 22:02

@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 updates accessibilityRespondsToUserInteraction in SemanticsObject.mm to return true only if the node contains actions other than system, scroll, or dismiss actions, and adds a corresponding unit test. Feedback on the changes points out a memory leak in the new test where MockAccessibilityBridge is allocated on the heap but never deleted, suggesting allocating it on the stack instead.

@LongCatIsLooong
LongCatIsLooong self-requested a review October 23, 2026 21:54
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
…flutter#194614)

Fixes flutter#157630

SnackBar incorrectly had an VoiceControl label attributed to it, because
SnackBar technically has 3 actions attributed to it - kDismiss,
kScrollUp, and kScrollDown.

In this PR I exclude kDismiss and kScrollUp/Down/Left/Right from ever
receiving VoiceOver labels.

- kDismiss: only maps to Escape, not Tap. It's only used in
`accessibilityPerformEscape`, which is the VoiceOver 2 finger Z-scrub or
verbal "Go back" command.
- kScrollUp/Down/Left/Right: Scrollables are rendered as a native
UIScrollView, not as an SemanticsObject, so shouldn't receive a
VoiceControl label.

<img width="814" height="1770" alt="image"
src="https://github.com/user-attachments/assets/cdf02512-d947-4473-9549-a280151f25bc"
/>

## 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 in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [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.

[A11y][iOS]: SnackBar shows more Voice Control labels than expected

2 participants