-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Try using the scroll container boundaries to determine scroll velocity #23446
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
talldan
added
[Type] Enhancement
A suggestion for improvement.
[Feature] Drag and Drop
Drag and drop functionality when working with blocks
labels
Jun 25, 2020
Size Change: +54 B (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
This was referenced Jun 25, 2020
Snip. I was actually commenting on the wrong PR. Also thank you for this PR, but I'll move this comment to the correct PR 😅 |
Hah, I had a feeling that might happen if I made two similar PRs 😄 Thanks for testing! |
:D |
talldan
force-pushed
the
try/block-drag-scroll-container-boundary
branch
from
June 26, 2020 03:19
17db537
to
0fd42d1
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[Feature] Drag and Drop
Drag and drop functionality when working with blocks
[Type] Enhancement
A suggestion for improvement.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This tries an iteration on the behavior in #23082.
See also #23448 for an alternative.
It's based on the refactor to hooks in #23444, so the diff looks bigger than it is. That PR should ideally be merged first.
How does this differ from #23082
In #23082, when the user drags more than 50px the page starts scrolling in the direction they've dragged. The speed of the scrolling is based on how far the user drags.
I found that sometimes with that behaviour it was a little difficult to stop the page from scrolling, since it's not always easy to connect that scrolling speed is related to where the I started dragging from.
This PR treats the center of the scroll container as the neutral zone, and only starts scrolling when the user moves the cursor towards the boundaries of the scroll container. It's similar to what browsers are supposed to do when dragging to the edge of a page, but much more exaggerated.
Drawbacks—the page starts scrolling when the block being dragged is already near the edge of the page.
How has this been tested?
Types of changes
Non-breaking enhancement
Checklist: