NiclasDev63 / tiptap-extension-global-drag-handle

MIT License
73 stars 13 forks source link

Unable to drag elements out of ul > li #24

Open jsxiaosi opened 1 month ago

jsxiaosi commented 1 month ago

When I drag a text, heading, or block element into an li tag, I am unable to successfully drag it out of the li. The li tag properties are always retained, and the element remains within the list structure.

NiclasDev63 commented 1 month ago

I have already noticed this bug, but it is not so trivial to fix it, because every time you have a listItem selected, you can change the selection to the child element e.g. the dragged in heading, which would fix this behaviour, but then you would have the problem that you could only ever select the child elements and thus never drag a listItem. There would have to be a way to differentiate between elements that already exist in a list, i.e. that belong to it, and newly dragged-in elements, which is of course possible, but somewhat more complex to do right. This has something to do with how tiptap handles lists and saves the elements within them. It's definitely on my to-do list, but it's not a top priority.