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
Scrollable.ensureVisible does not work with nested SingleChildScrollViews on both axes #65100
Comments
|
Hi @orischwartz |
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[v] Flutter (Channel beta, 1.20.0-7.2.pre, on Microsoft Windows [Version 10.0.18362.1016], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[v] Android Studio (version 4.0)
[v] VS Code (version 1.47.2)
[v] Connected device (1 available)
! Doctor found issues in 1 category.But this is reproducible on all builds/platforms since at least August 2019 -- no special setup required. |
|
I am currently investigating this issue. |
|
I was able to reproduce this on latest flutter doctor -v |
|
@orischwartz I modified the related algorithm(xu-baolin@49bc50c), and now it works as expected |
|
Fix had to be reverted. Will try to come up with a new test case covering the breakage. |
|
Quick update here: I'm starting to suspect the internal test this broke just needs to be updated. Trying to find the owners of that test to discuss further. At a high level, the test is using |
|
Ok! The basic problem here if you have a We might be able to somehow use the |
Thank you very much for your investigation and additional test cases. :) |
|
I believe I have a fix for this. Posting a PR. |
|
My original instinct to try to use |
|
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |

Steps to Reproduce
ColumnofRows and twoSingleChildScrollViews--one forAxis.horizontaland the other forAxis.vertical.Expected results:
Tapping any cell should center that cell in the viewport via
ensureVisible.Actual results:
Cells are not centered as expected. This works correctly when using just a single
SingleChildScrollViewbut not with two.ensureVisibledoes traverse all theScrollables in the context:flutter/packages/flutter/lib/src/widgets/scrollable.dart
Lines 312 to 323 in a8281e3
But something about nesting the scrollviews will yield different values here:
flutter/packages/flutter/lib/src/widgets/single_child_scroll_view.dart
Line 628 in a8281e3
This behavior has been present since 2019 and is reproducible on the latest beta branch on both iOS and Android.
The text was updated successfully, but these errors were encountered: