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

Fix svelte 4 warning for ARIA role #1835

Closed

Conversation

Isaac-alencar
Copy link

#1627

If as is neither 'a' nor 'button', it spreads the { role, tabindex } object.
if role is 'button', it won't be included as an attribute on the element, ensuring that the correct role is applied based on the element type specified by the as variable.

@reinink
Copy link
Member

reinink commented Apr 16, 2024

Hey! Thanks for this contribution, but I just tested this, and I'm still getting an ARIA warning:

vite v4.5.2 building SSR bundle for production...
transforming (27) ../../packages/svelte/src/index.js8:17:43 AM [vite-plugin-svelte] /Users/jonathanreinink/Sites/inertiajs-inertia/packages/svelte/src/Link.svelte:27:0 A11y: <svelte:element> with click, dblclick, mousedown, mousemove, mouseout, mouseover, mouseup handlers must have an ARIA role

What am I missing? 🤔

@reinink
Copy link
Member

reinink commented Apr 16, 2024

Think I'm going to just add a svelte-ignore for now to solve this, as I'm nervous about adding a role or tabIndex. I'm pretty sure this is a false positive, as @jessarcher suggested in #1635. Thanks either way for this contribution!! 🤙

@Isaac-alencar
Copy link
Author

Think I'm going to just add a svelte-ignore for now to solve this, as I'm nervous about adding a role or tabIndex. I'm pretty sure this is a false positive, as @jessarcher suggested in #1635. Thanks either way for this contribution!! 🤙

sounds good to me! thank you for the support on this one!

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

Successfully merging this pull request may close these issues.

2 participants