Issue #714πŸ’¬ AnsweredOpened January 5, 2018by michaellwatson0 reactions

Open Style Manager when selecting an element

Quick answerby artf

Hi Michael, there is actually a kind of bug in 'open-sm' which doesn't allow calling the command with runCommand but the reason is that it was designed to be called just by its relative button, indeed I'd recommend doing this for your case

Read full answer below ↓

Question

trying to do this

     editor.on('component:selected', (model) => {
          editor.runCommand('open-sm');
    });

gives the error this.sender.get is not a function

grapesjs.min.js toggleSm

Basically I want to open the style manager when clicking on an element.

Any help or info appreciated, thanks

Answers (2)

artfβ€’ January 5, 2018

Hi Michael, there is actually a kind of bug in 'open-sm' which doesn't allow calling the command with runCommand but the reason is that it was designed to be called just by its relative button, indeed I'd recommend doing this for your case

lock[bot]β€’ September 18, 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.