Closed GitRowin closed 1 year ago
This seems to be happening because SvelteKit sets tabIndex
on body
to -1 before focusing it after a navigation, which is necessary for accessible navigations:
That, in combination with this Tailwind code is enough to show the outline:
:-moz-focusring {
outline: auto;
}
You can override the :-moz-focusring
styles with your own but I'm not sure if that will cause other problems.
This seems to do the trick:
body:-moz-focusring {
outline: none;
}
I hope this can be fixed by SvelteKit though. Next.js and Nuxt.js do not have this problem.
Describe the bug
Important note: This ONLY happens in Firefox with Tailwind CSS.
Similar to: https://github.com/sveltejs/kit/issues/4180
Whenever I navigate (by using the address bar!) to a page that redirects to another page (using SvelteKit's goto), a focus outline appears at the bottom of the page:
Reproduction
https://github.com/GitRowin/sveltekit-outline-bug
Simply navigate to http://localhost:5173/test and you should see the focus outline.
Logs
No response
System Info
Severity
annoyance
Additional Information
No response