-
Notifications
You must be signed in to change notification settings - Fork 28.7k
SingleChildScrollView does not clip semantics child #114194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Looks like some tests are failing on this? |
semanticBounds.left, | ||
semanticBounds.top - offset.pixels, | ||
semanticBounds.right, | ||
semanticBounds.bottom + remainingOffset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this making the semantics clip larger than necessary? AFAK, "remainingOffset" is the distance from the top of the viewport to the end of the scrollable content, so the semantics clip here would be one viewport height to tall, no?
Not that it matters in practice, but may cause confusion in the future...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we actually add a test for this? The height of the semanticsClip rect should be exactly the height of the scrollable content, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, wait: _maxScrollExtent
is already accounting for the viewport width. Still, I think adding a test like I described above would be great.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
semanticBounds.left, | ||
semanticBounds.top - offset.pixels, | ||
semanticBounds.right, | ||
semanticBounds.bottom + remainingOffset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, wait: _maxScrollExtent
is already accounting for the viewport width. Still, I think adding a test like I described above would be great.
b36ff85
to
b502b37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
THanks for the test!
|
||
controller.jumpTo(2000); | ||
await tester.pump(); | ||
semanticsClip = viewport!.describeSemanticsClip(childRenderObject)!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: here and below are some extra whitespaces after the "="
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although we don't use fmt in flutter, I think should have lint or autoformat on indent at least.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto label is removed for flutter/flutter, pr: 114194, due to - The status or check suite Linux web_tests_7_last has failed. Please fix the issues identified (or deflake) before re-applying this label. |
auto label is removed for flutter/flutter, pr: 114194, due to - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
besides the expected scuba the other test failure doesn't seem related |
a49dd88
to
b1dd937
Compare
This reverts commit fa174b2.
Fixes #113615
I can't find a reason to clip it since it was laid out just to be thrown away during the semantics gathering stage.
The original issue is because some children are too far away from cache extent and gets throw away. the voiceover then think there is no child.
The alternative is to expose cache extent in single child scroll view, but it doesn't make sense as an API because everything will be laid out regardlessly.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.