Problem/Motivation
same layout visual but different HTML CLASS after some click and scroll
Steps to reproduce
Open Console and try test A & B separately. (Refresh before each tests.)
// test A
window.scrollTo(0, 200);
jQuery('.nav-primary__button').click();
window.scrollTo(0, 0);
console.log(jQuery('.site-header__fixable').attr('class')) // site-header__fixable fixable is-expanded
// test B
window.scrollTo(0, 200);
jQuery('.nav-primary__button').click();
jQuery('.nav-primary__button').click();
window.scrollTo(0, 0);
console.log(jQuery('.site-header__fixable').attr('class')) // site-header__fixable fixable
and aria-expanded also incorrect
Comments
Comment #2
droplet commentedComment #3
droplet commentedComment #4
mherchelThis is intentional. The
is-expandedclass indicates that the header should be expanded when the header is able to be collapsed (which only happens when the document is scrolled down a bit). We could potentially name the classis-expanded-on-scroll-down, but IMO this is too verbose.When the document is scrolled to the top of the page, we apply a
visibility:hiddenCSS property to the button, which removes it from the accessibility tree.Maybe a better way would be to disable the button when scrolled up (and then set
opacity: 0or something). However, that could probably be covered in #3177260: [META] Accessibility of Olivero header/menu regionClosing as "works as designed". Re-open if you strongly disagree.