Issue #1537💬 AnsweredOpened October 23, 2018by hpruvot1 reactions

Duplicate component not style

Quick answerby artf1

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:

Read full answer below ↓

Question

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 🙏

Answers (3)

artfOctober 30, 2018

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,
})
hpruvotOctober 30, 2018

Oh sorry I missed that option, thanks 👌

lock[bot]October 30, 2019

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.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.