Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
merged 4 commits into from
Oct 28, 2022

Conversation

chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Oct 27, 2022

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

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@flutter-dashboard flutter-dashboard bot added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Oct 27, 2022
@chunhtai chunhtai requested review from goderbauer and Piinks October 27, 2022 23:12
@goderbauer
Copy link
Member

Looks like some tests are failing on this?

semanticBounds.left,
semanticBounds.top - offset.pixels,
semanticBounds.right,
semanticBounds.bottom + remainingOffset,
Copy link
Member

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...

Copy link
Member

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?

Copy link
Member

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.

Copy link
Member

@goderbauer goderbauer left a 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,
Copy link
Member

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.

Copy link
Member

@goderbauer goderbauer left a 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)!;
Copy link
Member

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 "="

Copy link
Contributor Author

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.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 28, 2022
Copy link
Contributor

@Piinks Piinks left a comment

Choose a reason for hiding this comment

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

Flutter_LGTM

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 28, 2022
@auto-submit
Copy link
Contributor

auto-submit bot commented Oct 28, 2022

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.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 28, 2022
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 28, 2022
@auto-submit
Copy link
Contributor

auto-submit bot commented Oct 28, 2022

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.

@chunhtai
Copy link
Contributor Author

besides the expected scuba the other test failure doesn't seem related

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[iOS] [a11y] Unable to fully navigate page using talkback when using nested scroll views
3 participants