grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

Duplicate component not style

Open hpruvot opened this issue 8 years ago • 3 comments

Hi,

First of all, thanks a lot for the awesome work ❤️ !!!

I've a question about the duplication tool so here the steps to follow :

  • I drag&drop a text component
  • I change the style (color in green, weight, size, etc...)
  • I duplicate it
  • I change the color in red BUT the original component changes in red too because they have the same class

==> So is this possible to duplicate a component (or block) with the same style/attributes but continue to edit the cloned component without impacting the original component ?

Thanks a lot in advance 🙏

hpruvot avatar Oct 23 '18 17:10 hpruvot

Hi @hpruvot I'd like to say, at first, if you clone a component with a class and you change it, you see changes on both, this is because how classes work. If you want to avoid the editor creating classes for you, use this option:

grapesjs.init({
	...
	forceClass: false,
})

artf avatar Oct 30 '18 00:10 artf

Oh sorry I missed that option, thanks 👌

hpruvot avatar Oct 30 '18 08:10 hpruvot

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Oct 30 '19 08:10 lock[bot]