pmndrs / react-spring

✌️ A spring physics based React animation library
http://www.react-spring.dev/
MIT License
27.73k stars 1.18k forks source link

support removing attributes from animated elements #2293

Open LoganDark opened 3 weeks ago

LoganDark commented 3 weeks ago

Why

inert does not accept inert='', inert='false', inert='undefined' or etc. The attribute must be entirely removed in order to enable the element again. disabled works the same way.

What

If a value resolves to undefined (not null or false or otherwise) its attribute will now be entirely removed.

Checklist

changeset-bot[bot] commented 3 weeks ago

🦋 Changeset detected

Latest commit: 66bf995efd91371678172d888f1c2a0704961bf2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages | Name | Type | | ---------------------- | ----- | | @react-spring/web | Patch | | @react-spring/animated | Patch | | @react-spring/core | Patch | | @react-spring/parallax | Patch | | @react-spring/rafz | Patch | | @react-spring/shared | Patch | | @react-spring/types | Patch | | @react-spring/konva | Patch | | @react-spring/native | Patch | | @react-spring/three | Patch | | @react-spring/zdog | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
react-spring ✅ Ready (Inspect) Visit Preview Jun 13, 2024 2:41pm
LoganDark commented 1 week ago

I suppose right now it's impossible for a spring value to even be null or undefined without an interpolation (at least when using useSpring), because of #2295. I'm off work for the week, so I can look into this more next Monday (especially since writing brand new tests will probably require me to clone/install everything anyway).