GitMurf / obsidian-drag-and-drop-blocks

Drag and Drop blocks to move, copy and create block references.
81 stars 6 forks source link

Dragging to an empty file or less lines so the mouse isn't hovered over any line... gets stuck #15

Closed GitMurf closed 2 years ago

GitMurf commented 2 years ago

Reported by Omer via Discord DM.

I have this issue where sometimes when I drag using SHIFT/ALT it doesn't work and this little popup gets stuck (until I go into preview mode and back into edit mode)

MY RESPONSE:

This is good feedback as I should add some checks to help fix this but I think its a corner case because you are dragging into a test file that is completely empty. See how the drag drop horizontal line is still back with your original block you are dragging? Its because your mouse actually isn't hovering over a real line in the other file.

image

Compared to in your video when it did work on your second attempt the drag drop line did activate over there even though your mouse is still low on the page it seemed to pick it up that time.

image

GitMurf commented 2 years ago

Maybe to avoid this I will default start by adding the drop zone line at the last line in the file as soon as the mouse enters a new pane/note... just in case this happens again. Just as soon as mouse enters a new pane it will check if the horizontal drop zone line is in that pane yet and if not, will move it below the last line in the file. Then when/if you move your mouse up above into another line it will move/change/update as usual.