[material_ui] Fix ExpansionTile WidgetSpan semantics assertion - #12765
Open
ahamSel wants to merge 2 commits into
Open
[material_ui] Fix ExpansionTile WidgetSpan semantics assertion#12765ahamSel wants to merge 2 commits into
ahamSel wants to merge 2 commits into
Conversation
11 tasks
ahamSel
marked this pull request as ready for review
September 5, 2026 12:06
10 tasks
Contributor
There was a problem hiding this comment.
Code Review
This pull request sets container: true on the Semantics widget in ExpansionTile to ensure the live region forms the node that blockNode removes from focus traversal, resolving an Android semantics assertion when embedded in a WidgetSpan. It also adds a regression test for this scenario and a changelog entry. There are no review comments, so no feedback is provided.
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.
On Android, embedding an
ExpansionTilein aWidgetSpancan trigger a sibling-configuration conflict assertion when semantics are enabled. Its live-regionSemanticsusesAccessibilityFocusBlockType.blockNodebut can merge into the surrounding semantics tree.This makes the live region a semantics container, so
blockNodeapplies to an explicit node. The Android regression test uses the simpler reproduction suggested in flutter/flutter#190639.Fixes flutter/flutter#188298.
This ports flutter/flutter#190639 to
packages/material_ui. The earlier package PR, #12383, was closed while contributions were paused. This replacement is rebased onto current main following the request to move the fix here; GitHub would not reopen the old PR after the rebase.I used AI to help with the fix and regression test.
Pre-Review Checklist
[shared_preferences]///).Validation performed:
flutter test --no-pub test/expansion_tile_test.dart: 64 passed, one pre-existing skip.container: truemakes the new regression test fail with the original!conflictassertion; restoring it makes the test pass.flutter analyze --no-pub lib/src/expansion_tile.dart test/expansion_tile_test.dart: no issues.git diff --checkpass.Full repository CI is still pending. The release metadata uses
material_ui's batch-release convention: a pending changelog entry withversion: patch.The repository-wide
flutter_plugin_tools validatecommand could not complete in the local sparse checkout: its root README check requires other packages, beginning withanimations, that are not checked out. This check is left to CI.Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2