Add skip to component, id attribute for <main> - #2326
Conversation
| </script> | ||
|
|
||
| <style scoped> | ||
| .skip-button { |
There was a problem hiding this comment.
would it be possible to use UIKit's 'uk-invisible` class instead ?
There was a problem hiding this comment.
No, since it works with visibility: hidden which removes an object from the tabindex. But a skip link needs to be in there, albeit not visually present without being focused.
| @@ -0,0 +1,51 @@ | |||
| <template> | |||
| <button class="skip-button" @click="skipToTarget"><slot></slot></button> | |||
There was a problem hiding this comment.
depending how often we're going to need this, maybe we can implement this in the design system ?
There was a problem hiding this comment.
If the interface stays like this (the navigation being hidden away off-screen initially anyway) only one instance of a skip link (the one going to main) is necessary, in my opinion. Regarding other thoughts on SkipTo and ODS, see "Why no component in ODS?" above.
PVince81
left a comment
There was a problem hiding this comment.
Makes sense, thanks for the explanations 👍
Description
Adds skipTo functionality
Unfortunately vue-router has problem with the usual approach to implent skip link functionality, with links
<a href="#main">Skip to main content</a>. Issues around this are open for years (#1668 being the main and original one. But none of the workarounds listed there are actually moving focus to the container with the "#"-provided id (they are rather meddling with window.history or scrolling things into visible viewport, both of which hasn't reliable influence on the keyboard focus). So I solved the skipTo functionality with a button, which is not ideal, but at least a comprehensible way (compared to changes in the router itself). Once/if this behaviour will be resolved we could easily swap the<skip-to>component with a link.Why no component in ODS?
Several reasons:
Related Issue
#2324.
Motivation and Context
Reasoning
How Has This Been Tested?
Manually, only.
Screenshots (if appropriate):
Types of changes
Checklist:
Open tasks: