Fix dropcursor not updating the position on ongoing drag-event #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bdbch:fix/dropcursor-invalid-position-on-update"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR should fix issue prosemirror/prosemirror#1573. I tried to avoid using plugin states to store the prosemirror positions and map it across transactions and instead rely on recomputing the position of the dropcursor the same way we do on
dragover.Thanks. What is the reason for the lines that clear
lastEvent? I'd say that there's no harm in just keeping that around (which would also allow us to drop thethis.cursorPos > editorView.state.doc.content.sizebranch). If you're worried about leakingevent.target, we could also just store an{x, y}pair.I wanted to make sure that we don't somehow end up with a stale
lastEventstate and to clear the event when it was handled/canceled but I think you're right and it wouldn't really do any harm, since we always get a fresh one on dragover.Yeah basically what I said above but I think you're rightfully questioning if we can just keep it. I think we're fine with just going with keeping the event.
Hey @marijn I updated the PR. I removed the max content size overflow branch & also kept the
lastEventnow across different drag events and everything worked fine on my end. Let me know if you think something else is off or you'd like some adjustments.Thanks, looks great now. Merged as
8ca91f1Pull request closed