Can't enable 2 panel buttons at the same time
Thank you @Ju99ernaut , that's exactly what I needed.
Read full answer below βQuestion
Hi, I'm trying to enable more than one custom panel button at the same time. I think when I create some custom panel button (using code below) they will have the same behavior as normal html radio inputs, meaning that you can only select one and not more then that. See the example below when I try to enable both buttons but one disables the other: I want to enable both buttons at the same time, is there any property that I can add to do so? Here is how I create the panel buttons.
Answers (2)
Thank you @Ju99ernaut , that's exactly what I needed.
You have to add a different context for each button
editor.Panels.addButton('options', [{
//...
context: 'some string',
// ...
}]);
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2814
[QUESTION] Custom panel button that dynamically Enable/Disable user scripts
Hello and thanks for sharing such a good project. I'm trying to customize some things in the editor but I have some questions that I would...
Issue #2312
[QUESTION] - More control over panel buttons, dynamic panel buttons
Hi, I am trying to implement several more dynamic buttons for the panel, for example a save button that depending on some flag will show an...
Issue #1787
[Question] Change HTML of Panel buttons from span to button
I have created some Panels and would like to change the element of panel buttons from span to button as its more appropriate and looks bett...
Issue #5020
Changing Title Attribute on Views Panel Buttons Doesn't Persist
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? ChromeReproducible demo link https://jsfiddl...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βBrowse Plugin Categories
Jump directly to plugin category pages on the marketplace.