grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

BUG: Style Manager setTarget does not work

Open maryia-kabash opened this issue 6 years ago • 7 comments

Version: 0.16.22

What is the expected behavior? setTarget allows styling a CSS rule different from the selected component

Describe the bug Upon calling setTarget method Style Manager still has a selected component as styling target

What is the current behavior? setTarget doesn't update this.propTarget.model (updates this.propTarget.targets instead). Please compare the file style_manager\view\SectorsView.js: Version 0.14.62 https://prnt.sc/v28tc2 Version 0.16.22 https://prnt.sc/v28ttv

maryia-kabash avatar Oct 19 '20 10:10 maryia-kabash

Thanks for the report and the suggestion Maryia. The fix will be available in the next release (I hope to publish it tomorrow)

artf avatar Oct 23 '20 01:10 artf

Hello @artf ! I have a question regarding this fix - setTarget now updates classes in Class section correctly, but Style Manager doesn't reflect the actual styles. Please see - https://prnt.sc/vfzuvv Maybe these is an event that can be triggered to update the values in Style Manager?

maryia-kabash avatar Nov 09 '20 09:11 maryia-kabash

Thanks @maryia-kabash found the issue, will be fixed in the next release!

artf avatar Nov 15 '20 22:11 artf

@maryia-kabash @artf Hi! I am trying to use setTarget method to style different component instead of selected component. but the method is not working or may be I am not calling it correctly. I am calling the method as - styleManager.setTarget('.box');

so, I am expecting it to style the element with classname 'box' instead of selected component. But it is not working. I don't know where and how to call this method to work. Please help!!

RutujaBadbe avatar Mar 23 '21 10:03 RutujaBadbe

Hi @artf and @maryia-kabash

Still not working. This API was removed?

https://github.com/GrapesJS/components-tabs/blob/master/src/components/Tab.js#L17

image

ronaldohoch avatar Sep 12 '23 19:09 ronaldohoch

@ronaldohoch Yeah, that method was actually never a public one, so I've changed it to select in order to keep it more consistent with other modules.

artf avatar Sep 15 '23 15:09 artf

@ronaldohoch Yeah, that method was actually never a public one, so I've changed it to select in order to keep it more consistent with other modules.

currently the grapesjs-tabs plugin is still using the "setTarget", kindly change there or at least mention it in the readme file of it

hazho avatar Dec 24 '23 16:12 hazho