Issue #2719πŸ’¬ AnsweredOpened April 17, 2020by ajumell0 reactions

How can I mark a class name as protected or private in a component.

Quick answerby pouyamiralayi

Hi @ajumell checkout #1979 comment Cheers!

Read full answer below ↓

Question

Hi team,

First let me thank you all for creating this wonderful library. You guys are awesome.

I want to disable editing a specific class name in a component. like row and col. How can i do it. I saw private and protected option in selector_manager code. But I am not sure how to implement it. Can you guys please help me on this.

Answers (3)

pouyamiralayiβ€’ April 18, 2020

Hi @ajumell checkout #1979 comment Cheers!

ajumellβ€’ April 18, 2020

Hi @ajumell checkout #1979 comment Cheers!

Thanks for the response.

I have a doubt, this is generalised right, Do we have an option per component.

artfβ€’ April 23, 2020

@ajumell you can check the name of your selector before making it private

editor.on('selector:add', slc => 
	slc.get('name') === 'my-private-cls' && slc.set({ private: true })
);

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 β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.