-
Notifications
You must be signed in to change notification settings - Fork 324
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
[Inspector V2] Prevent inspector tree scroll from bouncing #8367
base: master
Are you sure you want to change the base?
Conversation
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 with one suggestion to add a comment.
@@ -990,9 +990,12 @@ class _InspectorTreeState extends State<InspectorTree> | |||
safeViewportHeight, | |||
); | |||
|
|||
final centerLeftHalf = Offset( |
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.
Is it worth leaving some documentation here explaining why we do this and referencing the original issue (or this PR)? ASCII art could work too ;-)
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.
Plus one to a comment and issue link 👍
Fixes #8356
Previously we were determining whether or not to trigger a scroll based on whether the top-left and bottom-right of an item in the tree was visible.
However, for items with long descriptions, we wouldn't actually horizontally scroll to their rightmost corner, which would cause the scroll controller to trigger a scroll that didn't actually do anything.
Now we decide whether to scroll based on whether the "center left half" (red dot below) of the item is in view.