Closed kickbk closed 4 years ago
Do you use the latest version?
@artf, yes I do. 0.15.9, although it's the same with prior versions. I tried to remove all the plugins to keep it all very clean, but still getting this as soon as localStorage is generated. Any ideas why or where this may get generated so I can debug?
It should only happen when you append an HTML that contains an already defined ID, so the editor increments it to avoid conflicts. Are you sure you don't append the same content twice?!
In any case, the function which does the check is here: https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/Component.js#L1262
Which is used here (when you append new content): https://github.com/artf/grapesjs/blob/dev/src/dom_components/model/Components.js#L51
I tried to reproduce this on your demo and could not, yet I am having the strangest issue. I was hoping you could point me in the right direction when debugging this.
As soon as I store the html in localStorage and refresh the page (you will see a short pause in the screencast), grapesjs magically adds "-2" to every id in the html. See screencast below:
Can you think where in your code this might be happening and why? How do I avoid this?
Thanks @artf