Open ankified opened 2 months ago
Ah, I think this is actually a CSS issue. Try adding this:
.bn-drag-preview {
position: absolute;
top: 0;
left: 0;
padding: 10px;
opacity: 0.001;
}
Hi @matthewlipski,
Thank you so much for providing the solution to this issue, I really appreciate it!
As a collaborator on the repository, I wanted to ask if you happen to know whether it’s possible to use ProseMirror or TipTap plugins with the VanillaJS implementation of BlockNote. Specifically, I’m looking into plugins like the TipTap comment extension (https://github.com/sereneinserenade/tiptap-comment-extension), the TipTap plugin that allows users to add Svelte components to the editor's content (https://github.com/sibiraj-s/svelte-tiptap), and the ProseMirror plugin for toggling between Markdown and WYSIWYM views (https://prosemirror.net/examples/markdown/).
If this isn’t the appropriate place to ask these kinds of questions, would it be better to open a new issue dedicated to this topic?
Thanks again for your help!
While I can't say for sure that things will work out of the box, you can add TipTap extensions to BlockNote like so:
const editor = BlockNoteEditor.create({
_tiptapOptions: {
extensions: [
// Add extensions here
]
}
})
And likewise with ProseMirror plugins, you just have to wrap them in a TipTap extension first (see https://tiptap.dev/docs/editor/extensions/custom-extensions/extend-existing#prosemirror-plugins-advanced).
Again I can't say for sure whether the ones you listed will work right away, will require some workarounds, or won't work at all, so just give them a shot and feel free to continue this thread if you run into issues.
Description:
I’m using the VanillaJS version of BlockNote within a SvelteKit project. While the editor works mostly as expected, I’m encountering an issue with drag-and-drop behavior.
Problem:
When dragging a block (using a custom drag button I created), the block's content is also being displayed underneath the editor, as though it’s being dragged separately in the DOM. This additional content persists below the editor during the drag action and doesn't behave as expected.
Steps to Reproduce:
Expected Behavior:
Dragging a block should only move the block within the editor, without creating an additional visual artifact (the block’s content) under the editor in the DOM.
Current Behavior:
The block's content is displayed beneath the editor during the drag event, creating a visual artifact that shouldn't be there.
Code Example:
StackBlitz example:
https://stackblitz.com/edit/sveltejs-kit-template-default-1rrnqy?file=src%2Froutes%2F%2Bpage.svelte