-
Notifications
You must be signed in to change notification settings - Fork 398
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
Allow layered ScrollContainer
s to coexist on input handling
#5118
Allow layered ScrollContainer
s to coexist on input handling
#5118
Conversation
This caused parenting `ScrollContainer`s to not receive drag events, therefore not allowing them to coexistence in the input hierarchy.
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.
Haven't tested yet, just reading code changes
// Continue from where we currently are scrolled to. | ||
Target = Current; | ||
|
||
return true; |
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.
Will need to check osu!-side to make sure nothing was relying on this behaviour, but I'm not strongly against this change if it works everywhere we expect it to.
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.
I would be interested to see if there's any scroll container overlayed on top of another component at all (unless wrapped in an OverlayContainer
of course).
The diagonal in that test does look arbitrary. Changing to a specific direction is probably fine. |
Made some minor refactors, but looks and feels good to me. Will wait for a second opinion for merge. |
This changes drag event handling and scroll event handling in
ScrollContainer
s to be based on theirScrollDirection
, to allow for layered scroll containers to coexist.This however becomes a nuisance on two parts:
20c1d72: In order for scroll containers to coexist, the innermost must not
OnMouseDown
to let the parenting scroll containers enter the mouse-down/drag input queue, for receiving drag events.I'm not entirely sure if there's a reason for that in the first place, checking with git blame threw me back to 4 years ago (General fixes. #316).
7bff9b9: When a scroll container is horizontal, scrolling vertically will also be considered as horizontal, therefore this coexistence change cannot apply when the inner scroll container is horizontal (as done in test).
In addition, it also results in this kinda weird UX (inner = horizontal, outer = vertical):
CleanShot.2022-04-22.at.06.47.29.mp4