Changing layerable in an an event at runtime doesn't immediately update
The same thing is happening when I try to add/remove a toolbar button in an event - the toolbar doesn't update until I unselect the component and reselect it:
Read full answer below ↓Question
When I change the layerable option of a custom component in an event, it still shows up in the layers until you drag it once. Is there some way to get around this by forcing the layers to update? Or can we get a bug fix for this, thanks. Video: Grapesjs layerable.zip
Answers (3)
The same thing is happening when I try to add/remove a toolbar button in an event - the toolbar doesn't update until I unselect the component and reselect it:
Also, if you set 'removable' to false in the same place as where 'layerable' is being set in my post, the toolbar doesn't update to remove the delete button until you save and reload.
Try to trigger this event after your updates editor.trigger('component:toggled')
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2404
Question: how to observe children changes in component
Is there an easy way to subscribe/listen to changes in the components/children of my custom component type? Perhaps an event I can subscrib...
Issue #3177
QUESTION/FEATURE REQUEST: Changing Selected Component Tooltip
Is there a way through the api to change the selected component tooltip or is that something that can only be done by editing the source? I...
Issue #2654
How to get the changed property from StyleManager
Hi, Is there a way to find out which property was changed in the StyleManager? For eg. If I select a Text component and change its backgrou...
Issue #639
Re-render Component on Canvas when tagName has changed
I'm trying to build a basic Header component that lets you select H1 to H6 with a trait. But when an option is selected, the canvas doesn't...
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.