prosemirror-dropcursor uses editorView.dom.addEventListener() instead of handleDOMEvents #1572

Open
opened 2026-05-21 16:28:06 +02:00 by dupski · 4 comments

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

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
Owner

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.

That does not make sense. handleDOMEvents is built on top of regular DOM events, so if addEventListener isn't receiving the event, neither will handleDOMEvents. (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.

> 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. That does not make sense. `handleDOMEvents` is built on top of regular DOM events, so if `addEventListener` isn't receiving the event, neither will `handleDOMEvents`. (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.
Author

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 handleDOMEvents was 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.

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 `handleDOMEvents` was 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.
dupski changed title from prosemirror-dropcursor uses legacy editorView.dom.addEventListener() instead of handleDOMEvents to prosemirror-dropcursor uses editorView.dom.addEventListener() instead of handleDOMEvents 2026-05-25 15:33:05 +02:00

@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.

@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.
Author

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 :)

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 :)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror#1572
No description provided.