-
Notifications
You must be signed in to change notification settings - Fork 40
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
Some outline on title on navigation #10
Comments
The outline is a foucus indicator. It shows which element has focus, so keyboard users know where they are at in a page. Svelte Navigator tries to improve accessibility in SPAs by implementing a focus management system, which focuses a relevant heading on navigation. Again, if you're interested, here is a great article, which describes how accessibility for SPAs can be improved. In fact, Svelte Navigators focus management is based upon suggestions from that study. The dotted outline is just the browsers default style for the focus indicator. You can change it through CSS. There are some suggestions for that in the first article I've linked. I might add some CSS to the examples in the future, to make it prettier and to give a suggestion on how to style it in an accessible way, but for now, I hope the explanation helps. |
Closing because the observed behaviour is in fact the desired behaviour. I've set up an issue to improve the documentation and examples, to better explain the behaviour and other accessibility related matters (see #11). |
@mefechoel accessibility is important but should this be a concern for router? Is it possible to provide some config to disable this feature or enable conditionally. I have not seen this feature in popular web apps. |
@mmrath Actually I think it should be a routers concern, because SPA routers have, for the longest time broken accessibility (see this article). If you consider a non SPA, if you click a link, the browser loads a new html document and focus is reset to the body of the page. Since the SPA router broke the accessibility, it should be its responsibility to fix it. You can disable focus management, by passing |
It's great that you take care for better accessibility. But I don't really understand why Svelte Navigator focuses only on the first heading element ( |
I agree. I appreciate the focus on accessibility, but it kinda looks horrendous when it focuses on the first heading element. My understanding is the SSR apps don't behave that way either. Would it not be better to simply change the focus back to the body instead (I may be wrong, but I believe this is what non-SPA apps do)? Solution to keep accessibility gains: Just remove the outline, this way it's still focused on screen readers but doesn't disrupt the looks of the page. |
As the heading can't be focused by tabbing anyway I decided to just add |
How are we supposed to design our apps with this ugly blue outline everywhere? Kinda silly! @DatDraggy thanks for the tip, it only works on each component though. To do this globally put this into the App.svelte file in the root.
|
Yes, as mentioned before, you can safely disable focus rings on headings. See comment with more detail on disabling focusrings. |
Describe the bug
On navigation title is highlighted. Looks worse than the attached screenshot when used with bootstrap. I could not figure out what is that outline.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The outline should not appear
Screenshots
attached, see the outline on "Login" title
The text was updated successfully, but these errors were encountered: