Why does the loading progress spinner "freeze" in the UI? #214
Unanswered
Jeremy-Knudsen
asked this question in
Q&A
Replies: 1 comment
-
I see that it is using CSS, but for some reason the spinner does not spin when I invoke the "loading" state of the button in |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I noticed that the loading spinner will "freeze" if calling a Figma method that uses the main thread and ends up taking a long time (e.g.
findAll()
). According to this Figma Plugin development guide regarding frozen plugins, you can keep the spinner animating if it uses CSS only. Since the loading progress spinner freezes, it makes me think that this is using JavaScript to animate it. I didn't want to file a bug if that is not the case, and I thought I'd just ask the question here if anyone knows. Here's the snippet form that page:———
Use CSS animations
An imperfect but inexpensive way to make the plugin look like it's not frozen is to have a progress spinner, implemented using only CSS animation (no JavaScript). Even when the rest of the UI is frozen, the CSS animation can still play on some browsers. The reason is that many browsers implement animation composition outside the main thread. However, note that this is only an aesthetic improvement.
Beta Was this translation helpful? Give feedback.
All reactions