Issue #542πŸ’¬ AnsweredOpened November 18, 2017by duskhacker1 reactions

Calling render() on PanelManager breaks style manager

Quick answerby duskhacker❀ 1

It occurs to me that I can just hide the button with some CSS, which is what I've done. I'm still curious about the render though.

Read full answer below ↓

Question

In lieu of #540, I'm trying to manually remove a button from the options panel, with this:

let pnm = editor.Panels;
pnm.getPanel('options').get('buttons').remove(pnm.getButton('options', 'gjs-open-import-template'));
pnm.render()

This works ok, the button goes away, but the pnm.render() seems to break the style manager, in that it becomes unresponsive. Non of the other stuff seems to break, just the styling. Is this a problem I'm introducing or a bug?

Thanks!

Answers (3)

duskhackerβ€’ November 20, 2017

It occurs to me that I can just hide the button with some CSS, which is what I've done. I'm still curious about the render though.

sbarfurthβ€’ February 28, 2018

This should be high priority, makes modifying panels after the first render impossible.

artfβ€’ November 9, 2018

I'm closing this as we've removed render method from the public Panel API, it should be executed only on init by the editor. In addition, now you can remove buttons easily by doing this panelManager.removeButton('panelId', 'buttonId')

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.