Skip to content

Commit 2b7c2a0

Browse files
authored
Merge pull request #22925 from nextcloud/dashboard/fix-skip-links
Dashboard: Fix accessibility skip links
2 parents f3ec3bf + caf284d commit 2b7c2a0

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

apps/dashboard/css/dashboard.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
// Suppress "Skip to navigation of app" link since the app does not have a navigation
2+
.skip-navigation:not(.skip-content) {
3+
display: none;
4+
}
5+
// Fix position of "Skip to main content" link since the other link is gone
6+
.skip-navigation.skip-content {
7+
left: 3px;
8+
}
9+
110
#header {
211
background: transparent !important;
312
--color-header: rgba(24, 24, 24, 1);

apps/dashboard/js/dashboard.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/dashboard/js/dashboard.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/dashboard/src/App.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ export default {
215215
},
216216
mounted() {
217217
this.updateGlobalStyles()
218+
this.updateSkipLink()
218219
window.addEventListener('scroll', this.handleScroll)
219220
220221
setInterval(() => {
@@ -321,6 +322,10 @@ export default {
321322
document.body.classList.remove('dashboard--dark')
322323
}
323324
},
325+
updateSkipLink() {
326+
// Make sure "Skip to main content" link points to the app content
327+
document.getElementsByClassName('skip-navigation')[0].setAttribute('href', '#app-dashboard')
328+
},
324329
updateStatusCheckbox(app, checked) {
325330
if (checked) {
326331
this.enableStatus(app)

0 commit comments

Comments
 (0)