-
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
Fix drag and drop indicator before first block and after last block #43135
Fix drag and drop indicator before first block and after last block #43135
Conversation
Size Change: 0 B Total Size: 1.27 MB ℹ️ View Unchanged
|
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.
The fix works well in my tests.
✅ I can see a drop indicator before the first block and after the last block.
✅ Now, I can also drop files and blocks on those positions.
The drop indicators inside the gallery do not always show up for the first and the last block. But probably can be handled separately.
Screencast
CleanShot.2022-08-11.at.10.08.42.mp4
I am also seeing this, it seems that for horizontal layouts like the gallery the indicator does not appear before the first block (left of it). It is showing after the last block however. cc @talldan |
What?
Reported in #43127, Partial fix for #32880
Fixes the drag and drop insertion point indicator at the start and end of block lists, which had regressed again.
This time adds e2e tests to prevent future regressions.
I did try writing these tests in Playwright, but the drag and drop utilities there are not quite as fully-featured as puppeteer's.
How?
The fix is easy, just changes some boolean logic around how the in-between inserter renders.
I think the regression keeps happening because contributors are trying to optimize performance but don't realise they're introducing a bug. Hopefully the added comments and tests will prevent this in future.
Testing Instructions
Note - if you drag too far (outside the bounds of the block list) dropping a block won't work and the insertion point won't be visible. This is already captured as an issue in #32880. It's a more complicate issue to fix.
Also worth testing:
Screenshots or screencast
Before
Kapture.2022-08-11.at.12.53.43.mp4
After
Kapture.2022-08-11.at.12.51.41.mp4