-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] Changing layerable in an an event at runtime doesn't immediately update #2433
Comments
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 |
That seems to solve the second issue - the extra toolbar button now appears and disappears immediately. However the change to 'layerable' still doesn't update the layers manager, and the 'clone', 'delete' and 'move' toolbar buttons don't disappear when 'copyable', 'removable' and 'draggable' are changed. This is my code: https://codesandbox.io/s/youthful-hill-s1t0u
|
For the |
@artf this didn't work for me. I'm creating a component which can only be placed once in the canvas. Here's my code and screenshots:
The duplicate component is removed, but it still shows up in the Layer Manager. Edit: I mate of mine suggested putting a slight timeout in the component!.remove() method call. It worked, but that's pretty ugly.
|
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
The text was updated successfully, but these errors were encountered: