GrapesJS / preset-webpage

GrapesJS Plugin Webpage Preset
http://grapesjs.com/demo.html
BSD 3-Clause "New" or "Revised" License
335 stars 291 forks source link

auto select stylemanager causes some problems #71

Closed doonfrs closed 2 years ago

doonfrs commented 2 years ago

Hi; I was trying to save the last selected panel for some reason.

I used panel view change:active event to save the currently active panel, then component:selected to activate the last saved panel, but because preset-webpage already have component:selected event which always switch to style manager, this will always reset the current view to style manager, I hope I explained the case well, I think we need to make this optional by adding new property like (autoShowStyleManager).

I hope I explained it well, I can create the PR, I am waiting for your opinion first.

https://github.com/artf/grapesjs-preset-webpage/blob/3e5a9e12998c9a32b6f1199953084163678e6c17/src/panels/index.js#L109

Thank you!

artf commented 2 years ago

I guess you can simply disable that logic (showStylesOnChange: false) and implement your own if necessary, I don't think we need a new option here