Issue #3509Opened June 1, 2021by theSC0RP1 reactions

QUESTION: How to programmatically change componentFirst?

Question

Hey @artf, I was trying toggle between using ids and classes for styling so I need to change the componentFirst attribute programmatically. But when I try to change the config, the behaviour doesn't change. This isn't working even in the demo. Steps to reproduce:

  1. Add two text blocks
  2. Give them the same class name.
  3. In the browser console, change the componentFirst property using editor.getConfig().selectorManager.componentFirst = false
  4. Add some color to the text. It is only added to the selected block

P.S. I also tried doing editor.refresh() after changing the config but that did not change anything.

Answers (1)

artfJune 10, 20211 reactions

You have to retrigger the selection after changing that option editor.trigger('component:toggled')

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.