Closed jacquesg closed 3 months ago
I just tested it and it seems to work. Can you provide the code to reproduce your behaviour?
Hi,
Well, its pretty standard stuff, the only thing that may be different could be the way we set up the Mentions plugin:
Mention.extend({
name: 'substitution',
}).configure({
HTMLAttributes: {
class: 'mention',
},
suggestion: makeSuggestionOptions(makeSubstitutions(substitutions)),
renderHTML({ node }) {
return ['span', { class: 'mention' }, `${node.attrs.label ?? node.attrs.id}`];
},
renderText({ node }) {
return `${node.attrs.label ?? node.attrs.id}`;
},
})
Also of interest maybe would be that the following node, when dragged, "drags" only the mention item, not the block:
{
"type": "paragraph",
"attrs": {
"textAlign": "left"
},
"content": [
{
"type": "text",
"text": "My "
},
{
"type": "substitution",
"attrs": {
"id": "country",
"label": "country"
}
},
{
"type": "text",
"text": " "
}
]
},
The newest commit should fix this issue
@NiclasDev63 Just tested it out, fixes it for me, thank you!
Thank you for an awesome plugin, this is exactly what I needed. There is a weird interaction with the Mention plugin:
While dragging, it correctly shows that it will drag the block, as soon as I drop it, it only takes the actual mention element, and leaves the remaining text in the original position.
What I'm seeing is below: