Closed yuzhva closed 4 years ago
Closing the issue, as I found the other solution:
const panelCustom = editor.Panels.addPanel({
id: 'panel__custom',
el: '.panel__custom'
});
const panelCustomButtons = panelCustom.get('buttons');
panelCustomButtons.add(topBarButtonsCenter);
But the issue with editor.Panels.addPanel({ buttons: [] });
still exist (=
Thanks @YUzhva for the report and the solution. I'll try to check this out
Same here, I tested the panels example (Getting started) in the docs too and keep getting duplicate buttons. @yuzhva solution works, thanks :)
Hi, @artf facing the same issue and @yuzhva solution not working for me as well. I am adding panels from (Getting started) docs but with different names.
did any one find any resolution for this ug in react
While creating a custom plugin, in case, when
editor.Panels.addPanel
is using inside plugin function - buttons are duplicated.Example: https://jsfiddle.net/kncdah8b/
Buttons are not duplicated:
Panels.addButton
API while loop buttons separatelyconst editor = grapesjs.init({})
has been createdCurrently, I'm using the next trick to avoid the duplications: