-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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 svelte-announcer
text configurable
#879
Comments
Is it possible to disable it? For speed, I was referring to anything "superfluous" for a given job that slows down execution / rendering in the main thread. |
No, it's not currently possible. I don't know that it's worth adding an option for it either as it's not likely a measurable difference |
Rereading those, I think we should have an issue that tracks making this configurable. Right now the text is hardcoded, which is not ideal, especially if your site is not in english |
@dummdidumm I agree 100%. Please @benmccann can you reopen? |
svelte-announcer
that appears in my final bundle?svelte-announcer
text configurable
Reposting from #307 For future consideration (haven't really thought this through): Could this be a component that can be imported via <script>
import Announcer from "...";
</script>
<Announcer let:title>
Hey, I've navigated to {title}
</Announcer> |
I think it's good that it's in there by default, rather than being off by default unless you import the component, because a lot of people will forget to import it. But the language and/or the text should definitely be configurable, to be able to adapt to the language spoken by the site's expected audience. And if a site's author can configure the text, then it's possible to set the text to |
The component solution would provide more flexibility in my opinion - easier to add translations, different announcer based in routes, etc. It could be added to the starter template so people will not be able to forget it. |
I looked into announcers a whole ago and researched the topic. It is great that this is considered and added to Svelte Kit by default. Good discussion in #307 . Now it is added by default (which is great), but without making it translatable, it might be causing more harm than gain (making non-English speakers encounter an English message every page they enter). |
Thought about this some more, and I think a simple function might be enough here and also propagate better that the result can only be a string, in constrast to a
|
This introduces a new `$app/a11y`, which for now only exports `setNavigationAnnouncer`. Closes #879
This introduces a new `$app/a11y`, which for now only exports `setNavigationAnnouncer`. Closes #879
This introduces a new `$app/a11y`, which for now only exports `setNavigationAnnouncer`. Closes #879
Currently the div for svelte-announcer only appears in pages of folders in routes and not for the default (home) page in routes. This is inconsistent. The svelte-announcer div could appear in the home page with a aria-live: off. This would be more consistent. Secondly, ideally the setting of aria-live would be dynamic. Regardless of which page a person first visits, the first page visited would be "off" and subsequent pages would be "assertive". For example if a Google search lead me to the About page, I'd probably want the content of $layout to be read. Then if I navigated "back" to the home page, I would not want the $layout read again. In that case I'd want aria-live: assertive. By adding the svelte-announcer to the home page, this behavior would be easier to add in the future without it being a breaking change to the HTML structure. Or perhaps keeping track of first page versus subsequent pages is the responsibility of the screen reader. The off|polite|assertive options for aria-live are not sufficient and a new option is needed to handle subsequent pages. I have very little experience with screen readers, so this could be way off. |
Our plan for this is to remove the 'Navigated to' prefix and just use |
Is your feature request related to a problem? Please describe.
I'm building for the first time my new app with svelte-kit and I found in my bundled app text like "Navigated to ...page name..." in a div with id:
svelte-announcer
.There is no info in docs about this.
Describe the solution you'd like
Understanding what we are talking about. And just in case you don't agree how to disable this mechanism.
Additional context
If it is about accessibility it should be possible to disable it because most of my works for example are for company devices used by specific personnel who only want maximum speed (often the hardware is very poor!). They (almost) never need "help" for visual or hearing impairments. And if and when it is needed we will provide.
The text was updated successfully, but these errors were encountered: