mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 08:16:43 -04:00
Merge pull request #37967 from nextcloud/fix/36926-The_visually_hidden_elements_of_the_navigation_on_the_left_are_always_read_by_screen_readers
Add `aria-hidden` attr to the whole navigation depending on a sidebar state
This commit is contained in:
commit
df5283ad05
3 changed files with 11 additions and 3 deletions
|
|
@ -160,6 +160,12 @@ export const initCore = () => {
|
|||
// we need this because dragging stop triggers that
|
||||
animating = false
|
||||
})
|
||||
snapper.on('open', () => {
|
||||
$appNavigation.attr('aria-hidden', 'false')
|
||||
})
|
||||
snapper.on('close', () => {
|
||||
$appNavigation.attr('aria-hidden', 'true')
|
||||
})
|
||||
|
||||
// These are necessary because calling open or close
|
||||
// on snapper during an animation makes it trigger an
|
||||
|
|
@ -213,6 +219,7 @@ export const initCore = () => {
|
|||
|
||||
// close sidebar when switching navigation entry
|
||||
const $appNavigation = $('#app-navigation')
|
||||
$appNavigation.attr('aria-hidden', 'true')
|
||||
$appNavigation.delegate('a, :button', 'click', event => {
|
||||
const $target = $(event.target)
|
||||
// don't hide navigation when changing settings or adding things
|
||||
|
|
@ -264,6 +271,7 @@ export const initCore = () => {
|
|||
|
||||
const toggleSnapperOnSize = () => {
|
||||
if ($(window).width() > breakpointMobileWidth) {
|
||||
$appNavigation.attr('aria-hidden', 'false')
|
||||
snapper.close()
|
||||
snapper.disable()
|
||||
|
||||
|
|
|
|||
4
dist/core-main.js
vendored
4
dist/core-main.js
vendored
File diff suppressed because one or more lines are too long
2
dist/core-main.js.map
vendored
2
dist/core-main.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue