Closed madebyfabian closed 3 years ago
@madebyfabian - can you try setting component.documentationLinks = []
?
This does work! @jlai-figma Thank you! Somehow I didn't thought about it.
We can add this to the documentation, thank you for raising this!
@jlai-figma this would be great, yes! Thank you!
Hello there. I was using the new https://www.figma.com/plugin-docs/api/properties/ComponentNode-documentationlinks/ property, and as there is told, it is currently only supported to add one link. That's fine. But what's really missing here is that "clearing" out the field.
I built a plugin ("Bunch Description Change") where users can do different things with their' component descriptions. I am currently adding support for the "documentationLinks" property, but other than on the "description", where I can clear it (just like in the UI), with the "documentationLinks", I cannot clear it. This may cause confusion for the user of my plugin.
When I try to mutate it by saying
component.documentationLinks = null
, it throws me an error saying that it's not allowed. But also when trying this:component.documentationLinks = [{ uri: null }]
(so exactly like in the docs) it also throws me an error saying that the type "null" is not allowed and a "string" type is required.It would be really helpful if you could just allow setting an empty string/null so the field can clear up, just like you're possible to do in the UI. Thanks!