-
-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
two nodes receiving .ProseMirror-selectnode
class in drag event
#917
Comments
I'm not seeing anything like the screencast in that glitch link—there's no blue line moving along with the dragged paragraph. Also your screencast appears to have drag handles, which are absent in the demo. |
oh, sorry if it wasn't clear - that gif was a reproduction of the error in my project but the glitch also has a more minimal reproduction just created a gif for the glitch as well, here's how that one looks: as you can see above, two nodes are receiving the styling applying to the note: since there's no handle, you have to drag an empty paragraph to reproduce it - since the bug seems to occur only when dragging entire nodes, not text itself |
Okay, I see. When you start dragging, the browser will create screenshot of the dragged element and use that as the cursor. There's no actual second element, I think. Scripts can use If you want, you can do some research as to whether removing the class for a moment directly after the dragstart event helps, but personally I don't really see this behavior as a big problem. |
appreciate the explanation. yea it's not a big problem, it just adds unnecessary noise UI wise. I will experiment with toggling classes to see if that works, thanks |
Issue details
in a single drag event, there's two nodes receiving the
.ProseMirror-selectednode
- the original node, and the node being draggedfrom gitter discussion, it appears this is a bug, and only the node being dragged should be receiving it.
Steps to reproduce
here's a minimal glitch (try dragging an empty paragraph, and you'll see two selected blocks being styled - I only added the default Prosemirror css)
https://glitch.com/~prosemirror-node-drag
ProseMirror version
Affected platforms
Screenshots / Screencast (Optional)
The text was updated successfully, but these errors were encountered: