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:
parent
ed7ad56266
commit
8a9907db52
|
@ -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
|
||||
|
|
|
@ -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')
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue