FEAT: how to edit a button if the button has an action (opening a modal window)?
Question
I have a html template. the html template has a button. when you click on the button, an event occurs (opening a modal window). Is it possible to visually change the appearance of a button without firing an event? With allowScript: 0, I can edit the appearance of the button, but in this case, the event does not fire (opening a modal window). In case of allowScript: 1, an event is triggered (opening a modal window), but there is no way to edit the appearance of the button. There were ideas to switch between allowScript 0 and allowScript 1, but allowScript removes all js from the page.
Answers (1)
You have to create a custom component for that button if it requires custom logic/behavior from what the original HTML does
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3162
Button switcher to editor.allowsCripts
Hello, @artf ! :) Maybe you can help with grapesjs. I have buttons which has own scripts(e.g. opening modal window by click). And if I set...
Issue #2129
[Question] how to append a button inside default modal and catch it's click event
I want a form inside a modal (using the default modal ), on click of the submit button make an ajax call. I have created a new component wh...
Issue #1390
Prevent Asset Manager from closing before selecting image
I want to keep the Asset Manager as long as possible if the user didn't select an image, how can I prevent the event bubbling from happenin...
Issue #6683
BUG: Modals close on mouseup event outside of modal rather than a full click
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 143.0.7499.169 Reproducible demo li...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.