fix accessibility and search form (#1501)

Co-authored-by: German Capuano <e@gcapu.com>
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
This commit is contained in:
German Capuano 2020-07-12 09:34:53 -04:00 committed by GitHub
parent ed7ad56266
commit 8a9907db52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 9 deletions

View File

@ -9,7 +9,7 @@ onmount('[data-js-search-form]', function () {
on(this, 'submit', (e) => {
e.preventDefault()
const link = document.querySelector('a[data-search-index]:visible')
const link = document.querySelector('a[data-search-index]:not([hidden])')
const href = link && link.getAttribute('href')
if (href) window.location = href

View File

@ -10,7 +10,8 @@ import qsa from 'dom101/query-selector-all'
export function showAll() {
qsa('[data-search-index]').forEach((el) => {
el.removeAttribute('aria-hidden')
el.removeAttribute('hidden')
el.style.removeProperty('display')
})
}
@ -31,10 +32,12 @@ export function show(val) {
.join('')
qsa('[data-search-index]').forEach((el) => {
el.setAttribute('aria-hidden', true)
el.setAttribute('hidden', true)
el.style.setProperty('display', "none")
})
qsa(selectors).forEach((el) => {
el.removeAttribute('aria-hidden')
el.removeAttribute('hidden')
el.style.removeProperty('display')
})
}

View File

@ -55,11 +55,6 @@ a:hover {
color: $base-b3;
}
/* prism.js adds area-hidden which it probably shouldn't */
[aria-hidden]:not(.line-highlight) {
display: none !important;
}
// No tooltips on mobile
@media (max-width: 580px) {
.hint--bottom {