shadcn-ui / ui

Beautifully designed components that you can copy and paste into your apps. Accessible. Customizable. Open Source.
https://ui.shadcn.com
MIT License
62.84k stars 3.53k forks source link

Painfully broken animations on mobile (screen capture inside) #2514

Closed FearlessSlug closed 4 months ago

FearlessSlug commented 5 months ago

ShadcnUI is using tailwindcss-animate which has a bug with the animation lagging/bugging out on mobile devices both IOS and Android, this means that every single component that uses tailwindcss-animate lib has this broken animation in some form, it is most noticable (and most painful) in the sheet component like in the video as well as in the toast component also in the video.

It seems like in tailwindcss-animate repo there's an issue opened since last year with no plans on fixing this bug tailwindcss-animate/issues/47

https://github.com/shadcn-ui/ui/assets/134693517/8008cffc-bccb-40b6-803f-17a80e5ccd51

devlzcode commented 5 months ago

can't repro on ios, used both chrome and safari

FearlessSlug commented 5 months ago

can't repro on ios, used both chrome and safari

What version of iOS? I reproduced this on a couple of iOS 15.X iPhones...

FearlessSlug commented 5 months ago

I'm not sure if there's any plan to add more sophisticated (and heavier) libraries for animations so there's no point in making a PR to switch tailwindcss-animate for FramerMotion for these problematic components, so I'll put a couple of links that helped me replicate the same animation but with FramerMotion (IMO the animations turned out to be even smoother with FramerMotion on both desktop and mobile)

Toast:

Sheet:

shadcn commented 4 months ago

This issue has been automatically closed because it received no activity for a while. If you think it was closed by accident, please leave a comment. Thank you.