grapesjs
grapesjs copied to clipboard
[Bug]: Programmatic retrieval of layers' visibility always returns `true`
Hello again :)
Our team might have found a bug while using the Layer Manager API: every call to component.viewLayer.isVisible() seems to always return true, regardless of their actual state.
Steps to reproduce:
- Open the demo
- Switch to the layers panel
- Click on the eye icon to hide the "Body" layer
- Open the console
- Executing
editor.getWrapper().viewLayer.isVisible()returns1instead offalse
Looking at the code, I believe this.model.getStyle() should be used instead of this.model.get('style') (which always returns {}) to retrieve the current display value.
As always, I'd be happy to open a PR to fix it !
Cheers :)
Yeah, you're totally right, the PR is welcome :)
Great ! #2879 opened.