Skip to content
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

Make outroing elements inert #8445

Closed
Rich-Harris opened this issue Apr 2, 2023 · 1 comment
Closed

Make outroing elements inert #8445

Rich-Harris opened this issue Apr 2, 2023 · 1 comment

Comments

@Rich-Harris
Copy link
Member

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

@dummdidumm dummdidumm added this to the 4.x milestone Apr 2, 2023
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
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
@benmccann
Copy link
Member

Implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants