Repository navigation
fix(a11y): stop sliders from freezing the desktop accessibility tree - #279
Merged
Merged
Conversation
Material's Slider always wraps its value indicator in an OverlayPortal. In a pushed route Flutter 3.47 then sends the engine a semantics node that no parent lists as a child (flutter/flutter#190357). The macOS and Windows accessibility bridges reject it, stay failed, and freeze their native tree on stale nodes; a later pointer move can then read a freed node and crash (flutter/flutter#193588). Part of #267. NavisSlider wraps Slider in its own Overlay.wrap(alwaysSizeToContent, Clip.none), which keeps the portal's semantics inside the slider. All 17 Slider sites use it and an architecture test forbids a bare Slider in lib. The wrap goes away once a stable Flutter ships flutter/flutter#193372. Co-Authored-By: Claude Sonnet <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Part of #267. On macOS, the app could crash after a settings or player screen with a slider was opened. Flutter 3.47.5's material
Slidersends the engine a semantics node that no parent lists (flutter/flutter#190357). The macOS and Windows accessibility bridges reject that update and stay broken. They freeze the native accessibility tree on stale nodes, and a later pointer move can read a freed node and crash (flutter/flutter#193588).Related issue: #267. The batched enqueue and the count-and-size confirmation follow in a separate PR.
Approach
NavisSliderwrapsSliderin its ownOverlay.wrap(alwaysSizeToContent: true, clipBehavior: Clip.none). That keeps the value indicator's semantics inside the slider's own subtree. All 17 slider sites use it, and an architecture test forbids a bareSlider/RangeSliderinlib/. The wrap can go once a stable Flutter ships the framework fix (flutter/flutter#193372).Validation
./tool/check.sh: not run locally (it can't run on this machine); CI is the gate.Failed to update ui::AXTreeerrors. After: 0 errors and 0 orphan nodes in 300+ updates, and navigation works.Evidence
Evidence: none, no visible change in normal use (see Risks for the value bubble).
Risks
Checklist
dev(orrelease/X.Yfor a release fix)AI Disclosure
Changelog
Fixed a macOS crash, and frozen screen-reader support on macOS and Windows, after opening a screen with a slider.