Select a small text part of the heading. (e.g. "very")
Drag it to an empty space, so that it creates a new node.
As you can see we have now created two nodes with a duplicate id. I have also reproduced that locally with the latest packages.
Quick-Fix
We have fixed it by automatically forcing the user to select the whole heading.
addProseMirrorPlugins() {
return [
new Plugin({
props: {
// Select the entire heading nodes when they are dragged
handleDOMEvents: {
dragstart(view, event) {
const { state, dispatch } = view;
const { doc, selection } = view.state;
const { from, to} = selection;
let minFrom = from;
let maxTo = to;
doc.nodesBetween(from, to, (node, pos) => {
if (node.type.name === 'heading') {
minFrom = Math.min(minFrom, pos);
maxTo = Math.max(maxTo, pos + node.nodeSize);
}
});
if (minFrom !== from || maxTo !== to) {
const tr = state.tr.setSelection(
TextSelection.create(state.doc, minFrom, maxTo)
);
dispatch(tr);
}
}
}
}
})
];
},
Info
Our team would really like to use this pro extension in production. However, this is the third bug we have encountered after testing it for two days. Is this extension considered stable or is it experimental?
It would be great if some additional logic or automated tests would be added that ensures the stability of this great plugin. We have a business-critical application and having suddenly two nodes with duplicate ids poses a big threat to us.
Affected Packages
@tiptap-pro/extension-unique-id, @tiptap-react
Version(s)
2.10.11
Bug Description
Simple steps to reproduce:
As you can see we have now created two nodes with a duplicate id. I have also reproduced that locally with the latest packages.
Quick-Fix We have fixed it by automatically forcing the user to select the whole heading.
Info Our team would really like to use this pro extension in production. However, this is the third bug we have encountered after testing it for two days. Is this extension considered stable or is it experimental?
It would be great if some additional logic or automated tests would be added that ensures the stability of this great plugin. We have a business-critical application and having suddenly two nodes with duplicate ids poses a big threat to us.
Thank you very much in advance for your help.
Browser Used
Chrome
Code Example URL
No response
Expected Behavior
Unique-ids should be unique as the name suggests.
Additional Context (Optional)
No response
Dependency Updates