-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Drop indicator for dragged elements like images #140
Comments
Perfect, thanks for the quick fix. I wondered if it the plugin configuration could become more flexible. I solved the problem in my code like this: class AppEditor extends Editor {
createPlugins() {
return [
...super.createPlugins(),
new dropCursor({
color: '#FF6347',
width: 2
})
]
}
} As you can see I add some configuration. I guess having config for each plugin would making things too complicated. But on the other hand I would now have to remove the So what do you think about moving the whole |
I thought it could be styled via CSS (just had a quick look and saw it had a class in the prosemirror example). But there is no dedicated class for it in neither tiptap nor prosemirror. I added an option |
Awesome, thanks! |
Hey @holtwick. I don't think I'll merge #141 for now (see PR for why) but you can easily create a tiptap extension for it. import { Extension, Plugin } from 'tiptap'
import { dropCursor } from 'prosemirror-dropcursor'
export default class DropCursorExtension extends Extension {
get name() {
return 'dropCursor'
}
get plugins() {
return [
dropCursor({
width: 2,
color: '#ccc',
})
]
}
} |
I see. @philippkuehn, the solution you propose is even better and I'm happily looking forward to it. Thanks for all the effort implementing the PR @Chrissi2812 |
My fault. I merged the PR. And it's released. |
It would be great to see a cursor for drag operations on where the dragged element would be inserted on release.
Example - not working: In https://tiptap.scrumpy.io/images drag the image to another place in the text.
Example- working: In https://prosemirror.net/examples/dino/ drag the dinos. A simple text cursor becomes visible.
Solution: Add
dropCursor
andgapCursor
plugins like here: https://github.com/ProseMirror/prosemirror-example-setup/blob/master/src/index.js#L56The text was updated successfully, but these errors were encountered: