You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a website that requires keyboard navigation and screen reader compatibility. The site must be accessible. But there are a few things I've found that I don't know if vanilla-back-to-top supports yet... or at least I couldn't find explanations of how to deal with yet.
Focus doesn't change: There's currently no way to choose and id or other element to change the focus to when clicking on the back to top button. That means that focus remains at the bottom of the page so when a user hits tab the next thing focus goes to is likely the tabs on your browser instead of the top of the webpage somewhere like a keyboard navigation user would expect. Here's one example, not a good one but at least an example.
Can't trigger with keyboard: I haven't found a way to select the back to top button with a keyboard yet. This is usually done with the enter or spacebar key.
My code
Here's the code I'm currently using to initialize this. Note I added aria-labelledby so screen readers will announce the text in title.
The problem
I'm working on a website that requires keyboard navigation and screen reader compatibility. The site must be accessible. But there are a few things I've found that I don't know if
vanilla-back-to-top
supports yet... or at least I couldn't find explanations of how to deal with yet.id
or other element to change the focus to when clicking on the back to top button. That means that focus remains at the bottom of the page so when a user hits tab the next thing focus goes to is likely the tabs on your browser instead of the top of the webpage somewhere like a keyboard navigation user would expect. Here's one example, not a good one but at least an example.My code
Here's the code I'm currently using to initialize this. Note I added
aria-labelledby
so screen readers will announce the text intitle
.The text was updated successfully, but these errors were encountered: