Issue #2523Opened January 22, 2020by MatejGlasnak0 reactions

[BUGS] Class selector set to active: false not working properly

Question

Hi i set: editor.on('selector:add', selector => selector.set({ active: false, }));

to NOT select class on element after click and editing css, it is working but after page refresh it is selecting element's classes again. Is there any way to fix it?

Answers (1)

MatejGlasnakJanuary 23, 20200 reactions

I found solution. Selector:add is called only when new component is added, but selector settings for that component wont save. After page reload it wont be called to previously saved components so they will have default value (true). To fix this problem, call this after components has been loaded.

editor.SelectorManager.getAll().map(selector => { selector.set({ active: false }) })

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.