shikijs / shiki-magic-move

Smoothly animated code blocks with Shiki
https://shiki-magic-move.netlify.app/
MIT License
1.11k stars 32 forks source link

fix: containerStyle true blocks render promise from resolving #9

Closed paoloricciuti closed 2 months ago

paoloricciuti commented 2 months ago

Closes #8

I tried with the approach i described in the issue but it didn't work because the promise is created way before the transition actually start.

The only way i can think of to prevent the promise to block if the transition doesn't start is to manually check if the changes will impact the container and avoid pushing the promise at all.

I tested this in stackblitz and it seems to work but if you have any suggestions feel free to guide me.

EDIT: here's the stackblitz with the fix applied (for the wrong behavior look at the issue)

https://stackblitz.com/edit/github-b1z8zy-2mgzpn