You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently it can be very hard (or impossible) to drag a block between two adjacent blocks. When dragging over a block, the calculations are very specific to the edge of the elements you're dragging over, so when two blocks are adjacent, there's often no breathing room or threshold to allow someone to drag between the two adjacent blocks. Here's an example screengrab:
2023-11-23.14.06.15.mp4
In the above screengrab, the drag is considered either as the last child of the top block, or the first child of the bottom block.
A possible solution
Can we add in a threshold of some kind when dragging toward the edge of blocks, that detects how close we are to the edge of the overall rootClientId, and if we're within a threshold of the edge of that block (say, within 15px or so), then consider the drop target position to be before or after that root / container block, rather than within it.
Ideally, something like this should make dragging and dropping feel a little more forgiving, rather than the user needing to be super precise in order to drag between blocks.
Some places to look
In the drag and drop code, take a look at the getDropTargetPosition logic, and further down in that file, the callback passed to useThrottle within useBlockDropZone. Perhaps we can examine distances between the cursor position and the very edge of the container block, and deliberately set before/after based on a threshold of some kind.
Started a (very early) WIP over in #56466 that seems promising. It's very hacked together for now, as the drop indicator line visual feedback hasn't been implemented yet, but I think the overall direction might work!
Activity
andrewserong commentedon Nov 23, 2023
Started a (very early) WIP over in #56466 that seems promising. It's very hacked together for now, as the drop indicator line visual feedback hasn't been implemented yet, but I think the overall direction might work!