Issue #3305✓ SolvedOpened Mar 3, 2021by RaresVlaiduc11 reactions

Button not set as active on click

Quick answerby Ju99ernaut9

Grapesjs requires your commands to have the run and stop functions for them to toggle panel buttons automatically, so maybe that might be the issue:

Read full answer below ↓

Question

Version: v0.16.41 Are you able to reproduce the bug from the demo? [ ] Yes [x] No What is the expected behavior? When I click on a button, the gjs-pn-active class should be added. Describe the bug detailed I have 3 buttons for 3 different devices (desktop, tablet and mobile). I have them on a top panel and when I click on them the canvas changes the size but the clicked button is not set as active. Are you able to attach screenshots, screencasts or a live demo? [x ] Yes (attach) [ ] No

Answers (3)

👍 Most helpfulJu99ernautMar 3, 2021

Grapesjs requires your commands to have the run and stop functions for them to toggle panel buttons automatically, so maybe that might be the issue:

kerryj89Mar 26, 2021

@Ju99ernaut Thank you for that. Active state is now working for me when creating devices-c panel through grapesjs.init().

GJSBlockMay 17, 2026

Thanks for reporting this, @RaresVlaiduc. The issue with (v0.16.41) Button not set as active on click appears to be a race condition or state management timing problem. This typically happens when component lifecycle events and DOM modifications overlap, creating an inconsistent state. What to try:...

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.