I have made a designer app that applies a global comboclass to the selected element. I was able to successfully add the global comboclass to the selected element. However, the comboclass does not reflect in the right-hand side “Style” Panel. If I click on the selected element again, then the global comboclass is updated in the right-hand side “Style” Panel.
Is this a bug or an expected behaviour? If it’s an expected behaviour, how can I “refresh” the style panel to reflect changes made by my app.
I agree Webflow doesn’t support adding combo classes to elements using the Designer API. Here, I am talking about a different case, where I am adding a global comboclass rather than a comboclass.
FOR EXAMPLE, I have an element with a Style = “Pencil”. “Pencil” can also be found in “All Styles” panel. I can assign this Style “Pencil” to any other element. Here, I refer this Style “Pencil” as a global comboclass.
Using the Designer API, I can do:
const element = // any webflow element that supports Style
const PencilStyle = await webflow.getStyleByName("Pencil");
const existingStyle = await element.getStyles()
element.setStyles([existingStyle, PencilStyle])
await element.save()
This code runs successfully without any error or warning. It inserts “Pencil” as a global comboclass to the element along with the existing comboclass on the element.
BUT, the right hand side “Style Panel” does not get updated with the Styles. I have to click on the element again (even if the element is selected) and then the “Style Panel” reflects the newly added “Pencil” Style
Back to my question:
Is this a bug or an expected behaviour? If it’s an expected behaviour, how can I “refresh” the style panel to reflect changes made to Styles by my app.
Thanks heaps for that! I’ve got a feeling this could be the current expected behaviour.
However, I’d love to dig into this a bit further. Could you please contact us here: Developers - App Development | Webflow Support - and ask for me in your request? If you could also share the read-only link to a site you’re seeing this on.