Spacings / Tokens sometimes do not get applied when first Grouping, then applying Auto Layout
Describe the bug Sometimes spacings and other tokens are not getting applied when using the native Figma App. When clicking on a token nothing happens. In Chrome it works perfectly fine with the same file. Same issue over multiple devices and users.
Expected behavior Consistent behaviour of applying tokens
Can you try to reproduce it or describe a scenario where we could try to reproduce that? Haven't heard of that before.
I think I found out why this is happening.
A user in Slack reported that they're unable to apply Auto Layout tokens when the layer was first grouped, then auto layout applied
So, to reproduce:
- Select two rectangles
- Press Cmd + G
- Press Cmd + A
- Apply a spacing token
Nothing happens.
The cause for this is that we currently check the type of a Node when Figma sends a selectionchange event. However, as the user uses keyboard commands (or the context menu) to convert to Auto Layout, we are not aware of that change.
We'll fix this by making sure to re-evaluate the selected nodes directly before we update it.
Setting this to blocked as this is a Figma issue. Reported it in the Figma Plugin developers Slack.
@six7 proposing we archive this one as its stale