-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Make outroing elements inert
#8445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Comments
dummdidumm
added a commit
that referenced
this issue
May 24, 2023
that way they are invisible to assistive technology and can't be interacted with, which makes sense since the element is already "dead" and only transitioning out at this point closes #8445
5 tasks
dummdidumm
added a commit
that referenced
this issue
May 26, 2023
that way they are invisible to assistive technology and can't be interacted with, which makes sense since the element is already "dead" and only transitioning out at this point closes #8445
Implemented |
it would be nice to mention this in the transition docs. I was applying my own styles based on whether an element was inert or not and was wondering why those styles were applied when transitioning out. Easy to figure out but a small mention in the docs would have been nice |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem
An element that is being removed from the DOM is still interactive, and still part of the accessibility tree. This means that (for example) it's possible to accidentally invoke a click handler on an element that should be 'dead'.
Since transitions are purely visual flourishes, it doesn't really make sense that outroing elements are still accessible.
Describe the proposed solution
The good news is that there's an
inert
property that can be applied to elements, which has exactly the desired effect.The bad news is that it isn't supported everywhere.
The good news is that it will be supported everywhere when Firefox 112 comes out next week.
Since this is a breaking change (theoretically someone could be relying on the chaotic behaviour?), it ought to be part of Svelte 4 anyway, so the timing will work out nicely.
Alternatives considered
Not doing this
Importance
nice to have
The text was updated successfully, but these errors were encountered: