Skip to content

[web] Expose mixed tristate checkboxes as aria-checked="mixed" - #194586

Merged
auto-submit[bot] merged 4 commits into
flutter:masterfrom
ChristophyBarth:fix/194547-web-tristate-checkbox-with-value-null-is
Oct 29, 2026
Merged

auto-submit[bot] merged 4 commits into
flutter:masterfrom
ChristophyBarth:fix/194547-web-tristate-checkbox-with-value-null-is

Conversation

@ChristophyBarth

@ChristophyBarth ChristophyBarth commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

On the web, a tristate Checkbox whose value is null was announced by screen readers as not checked. SemanticCheckable set aria-checked to "true" or "false" only, so the CheckedState.mixed the framework sends for that state became "false".

This sets aria-checked="mixed" for checkboxes in the mixed state. Radio buttons and switches keep "true"/"false", because ARIA defines "mixed" for checkboxes only. The existing Checkable behavior, which already handles "mixed", isn't reused here because it ignores the toggled state that switches rely on.

Adds a test next to the existing checked and unchecked checkbox semantics tests.

Thanks to @jorgelrj for tracking down the cause in the issue; this implements the first fix suggested there.

Fixes #194547

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

SemanticCheckable wrote aria-checked as "true" or "false" only, so a
tristate Checkbox with value null reached screen readers as unchecked even
though the framework sends CheckedState.mixed. Checkboxes now report
"mixed" for that state. Radio buttons and switches keep true/false, since
ARIA defines "mixed" for checkboxes only.

Fixes flutter#194547
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) platform-web Web applications specifically team-web Owned by Web platform team labels Oct 16, 2026

@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 introduces support for rendering the mixed state of a tristate checkbox by setting the aria-checked attribute to "mixed" when appropriate. A review comment identifies an issue in the new test case where the isEnabled property of SemanticsFlags is incorrectly assigned a ui.Tristate value instead of a boolean.

@flutter-zl
flutter-zl self-requested a review October 21, 2026 17:41
flutter-zl
flutter-zl previously approved these changes Oct 23, 2026

@flutter-zl flutter-zl 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.

LGTM, thanks for the fix.

Verified end to end with a before/after demo built from the same app:
https://flutter-demo-80-before.web.app renders the tristate checkbox as
aria-checked="false", https://flutter-demo-80-after.web.app renders
aria-checked="mixed", and the switch and radios are unchanged between the two.

@flutter-zl flutter-zl added the CICD Run CI/CD label Oct 23, 2026
@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 23, 2026
@flutter-zl
flutter-zl requested a review from hannah-hyj October 23, 2026 05:08

@hannah-hyj hannah-hyj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@flutter-zl flutter-zl added the CICD Run CI/CD label Oct 27, 2026
@flutter-zl flutter-zl added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 27, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 27, 2026
@auto-submit

auto-submit Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/194586, because - The status or check suite ci.yaml validation has failed. Please fix the issues identified (or deflake) before re-applying this label.

@flutter-dashboard flutter-dashboard Bot removed the CICD Run CI/CD label Oct 27, 2026
@flutter-zl flutter-zl added CICD Run CI/CD autosubmit Merge PR when tree becomes green via auto submit App labels Oct 28, 2026
@auto-submit

auto-submit Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/194586, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 29, 2026
@flutter-zl flutter-zl added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 29, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Tristate Checkbox with value null is exposed as aria-checked="false"; SemanticCheckable never writes "mixed"

3 participants