BlockNote icon indicating copy to clipboard operation
BlockNote copied to clipboard

Blue border around custom block when dragged

Open dvarjun opened this issue 1 year ago • 2 comments

Describe the bug When custom blocks are dragged a blue border appears around them. It looks like ProseMirror-selectednode css class is being applied on custom blocks.

To Reproduce Click the drag icon for the alert custom block and try moving it.(https://www.blocknotejs.org/docs/custom-schemas/custom-blocks)

dvarjun avatar Aug 09 '24 23:08 dvarjun

@dvarjun Add this to your css file

.ProseMirror-selectednode > .bn-block-content > *,
.bn-block-content.ProseMirror-selectednode > * {
  outline: none !important;
}

lamtuanamc avatar Sep 13 '24 10:09 lamtuanamc

@dvarjun Add this to your css file

.ProseMirror-selectednode > .bn-block-content > *,
.bn-block-content.ProseMirror-selectednode > * {
  outline: none !important;
}

To add to this, you can scope these styles to just the drag preview like this:

.bn-drag-preview .ProseMirror-selectednode > .bn-block-content > *,
.bn-drag-preview .bn-block-content.ProseMirror-selectednode > * {
  outline: none !important;
}

matthewlipski avatar Sep 13 '24 13:09 matthewlipski