Issue #2273πŸ’¬ AnsweredOpened Sep 17, 2019by slellampati0 reactions

Stop function of all commands are getting executed before the actual run command.

Quick answerby mcottret

Hi @slellampati, I'm sorry this answer might be a little late to the party, but I've just stumbled upon the same behaviour & discovered this issue. To answer the question: GrapesJS's buttons have an active event listener, which deactivates all buttons in a panel in which a button is activated, causing their stop comma...

Read full answer below ↓

Question

I created 3 custom button(edit, preview, save) and all those have run and stop methods. When i click on any button, it triggers the run command of that button but before that stop function of other buttons are executed. When i click on Edit, below is the console output When Edit button closed (stop command) What is causing the other stop commands to trigger first even when i dont have any event listeners?

Answers (2)

mcottretβ€’ Mar 11, 2020

Hi @slellampati, I'm sorry this answer might be a little late to the party, but I've just stumbled upon the same behaviour & discovered this issue. To answer the question: GrapesJS's buttons have an active event listener, which deactivates all buttons in a panel in which a button is activated, caus...

artfβ€’ Mar 18, 2020

You can add a different context: 'eg. save-button' to your buttons to detach them from this default behavior (by default buttons share the same context)

There is actually a tiny reference in getting started guide about this: https://grapesjs.com/docs/getting-started.html#panels-buttons

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.