Proper way to programmatically open the Traits/Style Managers' panels? #5910
-
Hello! In my GrapesJS project, I've defined two keymaps to open the Traits Manager and the Style Manager, respectively. I'm currently doing this: editor.Panels.getButton('views', 'open-tm').set('active', true); It seems like I emulate a button click (which looks like a hack), so my question is the following: Is it the proper way to open a panel? Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
If you try your code with the default grapesjs it works as expected so I guess it might be related to your customizations. |
Beta Was this translation helpful? Give feedback.
Of course, those are 2 different things, Command API and Panel API.
If you want the panel/button to react you have to use Panel API, which triggers the Command API but not the opposite way, otherwise it would be a total mess.