-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Add adaptive vertical positioning to RenderFollowerLayer #157921
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
Add adaptive vertical positioning to RenderFollowerLayer #157921
Conversation
|
This pull request has been changed to a draft. The currently pending flutter-gold status will not be able to resolve until a new commit is pushed or the change is marked ready for review again. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
3b00bb1 to
7e2dad5
Compare
7e2dad5 to
59c4d84
Compare
## Description This PR removes `DropdownMenu` usage of Leader/Follower. Leader/Follower positioning was introduced in #154667 which uses Leader/Follower approach to fix some weird positioning issues (such as #149037). Unfortunately, it also introduces some regressions, see: - #157916 - #158924 Because #154667 is already included in the beta channel, cherry-picking this PR should be considered. ## Context This PR is not a full revert and keeps Leader/Follower usage in `MenuAnchor` because this usage is optional and doesn't cause any regression. There are some ongoing work which might fix or mitigate this problem: - #157921 - #158255 ## Related Issue Fixes #157916 Fixes #158924 Reopens #123395 Reopens #149037 Reopens #151856
…#158930) ## Description This PR removes `DropdownMenu` usage of Leader/Follower. Leader/Follower positioning was introduced in flutter#154667 which uses Leader/Follower approach to fix some weird positioning issues (such as flutter#149037). Unfortunately, it also introduces some regressions, see: - flutter#157916 - flutter#158924 Because flutter#154667 is already included in the beta channel, cherry-picking this PR should be considered. ## Context This PR is not a full revert and keeps Leader/Follower usage in `MenuAnchor` because this usage is optional and doesn't cause any regression. There are some ongoing work which might fix or mitigate this problem: - flutter#157921 - flutter#158255 ## Related Issue Fixes flutter#157916 Fixes flutter#158924 Reopens flutter#123395 Reopens flutter#149037 Reopens flutter#151856
|
Closing and I will revisit once #158255 will land. |
|
Hi @bleroux, was this effort abandoned? |
|
@pathconnected This is tricky to implement correctly. I might get some bandwidth to work again on this in the coming weeks. |
Description
This PR adds adaptive positioning to Leader/Follower.
Doing so a follower position can be automatically modified if not enough space is available.
For the moment, only bottom overflow is implemented as it corresponds to DropdownMenu use case.
Context
Since #154667,
DropdownMenurelies on Leader/Follower approach in order to position the menu below the text field.While this change was needed to fix several positioning issues where the menu did not move while the text field did, it also introduced a regression as the menu is always positioned below the text field and might not be visible or be partially visible.
This PR aims to fix this issues by adding an adaptive positioning logic at the Leader/Follower level. Doing so this logic would be reusable for other widgets (for instance Autocomplete which faces the same problem).
Related Issue
Fixes DropdownMenu menu always appears below the TextField
Tests
Adds 6 tests.