prosemirror-dropcursor uses editorView.dom.addEventListener() instead of handleDOMEvents #1572
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Hi There
We're using prosemirror-dropcursor plugin inside a React & TipTap application.
We have an issue with the drop cursor not being removed when content is dropped.
We've tracked it down to it not reliably receiving the "drop" event, which we believe is due to its use of editorView.dom.addEventListener() instead of the modern handleDOMEvents pipeline.
I am aware this is not a "core" prosemirror plugin, so is not being actively maintained - are you guys planning to do any work on it in the future that might fix the above?
Alternatively, would you be interested in a PR that fixes this issue?
Thanks
That does not make sense.
handleDOMEventsis built on top of regular DOM events, so ifaddEventListenerisn't receiving the event, neither willhandleDOMEvents. (The weird labeling of 'legacy' and 'modern' here suggests you may be getting your insights from an LLM. You'll want to treat such insights with some skepticism.)If you can reproduce your drop cursor issue without TipTap or React, please show me how, and I can try to debug it.
Apologies for my ignorance @marijn , I am new to prosemirror. I was using React as my point of reference where manually adding event handlers is generally frowned upon, hence my assumption that
handleDOMEventswas the more 'correct' way to do it.Yes no problem, I will have a play and see if I can replicate the issue in vanilla prosemirror.
prosemirror-dropcursor uses legacy editorView.dom.addEventListener() instead of handleDOMEventsto prosemirror-dropcursor uses editorView.dom.addEventListener() instead of handleDOMEvents@dupski did you implement prosemirror-dropcursor yourself into Tiptap or are you using a Tiptap extension that implements it? If this is a Tiptap issue, send it over on our Github repository instead to keep the upstream issue tracker clean.
Hi @bdbch - we were using the TipTap gapcursor extension, so if it turns out to be a TipTap issue I'll log it there instead.
Apologies for the delay, I am just waiting for authorisation from my employer to spend more time on this :)