Fix SemanticsNode.rect position for nested scrollables with useTwoPan…#62359
Fix SemanticsNode.rect position for nested scrollables with useTwoPan…#62359fluttergithubbot merged 1 commit intoflutter:masterfrom
Conversation
|
@goderbauer This behavior wasn't covered by tests before, and I don't have enough knowledge on how the framework is typically used to know if this could break other sliver/scrolling/nesting configurations. Can you think of any issues this might introduce? The debugging logs in the linked comment might give more context on the issue, but are admittedly hard to follow. I'm available to discuss further or elaborate on the logs. |
|
cirrus looks unhappy, can you rebase off the master branch? |
0a75b49 to
52fa1f1
Compare
Had to also fix some lints I missed, but seems good now. |
gaaclarke
left a comment
There was a problem hiding this comment.
The code and test looks good to me. I'll defer to the others with respect to the wisdom of the change as-is. Nice sleuthing.
…eSemantics
Description
Issue
If a scrolling widget such as
ListVieworGridView(withshrinkWrap: true) is nested under another scrolling widget such asSingleChildScrollView, then new "beyond the fold" content which is revealed by swiping off screen cannot be selected by tap, and continued swiping beyond the fold will eventually make a11y focus jump to a random element on iOS.Repro case
Fix
The inner semantics pane of the child
ListView/GridViewneeds to have its position updated to match the outer semantics pane when the parentSingleChildScrollViewscrolls.This comment on issue #61631 explains the technical details of the fix.
Related Issues
Fixes #61631
Tests
I added the following tests:
widgets/scrollable_semantics_test.dartrectof the inner and outer semantics panes of aListViewmatch when nested under aSingleChildScrollView. The parentSingleChildScrollViewis scrolled to the end -> beginning -> middle of the shrink-wrappedListView's hidden elements to test both scroll directions.Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.