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.
Do you have any more information what you mean by global combo class or how you are adding this?
We currently don’t support adding combo classes to elements using the Designer API.
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()
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.
I hope I am more clear about the question now
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.