Resolve ARIA warning
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
class="lightbox"
|
class="lightbox"
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
aria-describedby="lb-caption"
|
aria-describedby="lb-caption"
|
||||||
closedby="any"
|
inert
|
||||||
>
|
>
|
||||||
<header>
|
<header>
|
||||||
<button type="button" class="lb-close" aria-label="Close"
|
<button type="button" class="lb-close" aria-label="Close"
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ function openLightbox(name, type, caption) {
|
|||||||
</picture>`;
|
</picture>`;
|
||||||
}
|
}
|
||||||
lbCaption.textContent = caption || '';
|
lbCaption.textContent = caption || '';
|
||||||
|
dialog.removeAttribute('inert');
|
||||||
dialog.setAttribute('aria-hidden', 'false');
|
dialog.setAttribute('aria-hidden', 'false');
|
||||||
dialog.showModal();
|
dialog.showModal();
|
||||||
}
|
}
|
||||||
@@ -65,6 +66,7 @@ function closeLightbox() {
|
|||||||
if (lbContent) lbContent.innerHTML = '';
|
if (lbContent) lbContent.innerHTML = '';
|
||||||
if (lbCaption) lbCaption.textContent = '';
|
if (lbCaption) lbCaption.textContent = '';
|
||||||
dialog.setAttribute('aria-hidden', 'true');
|
dialog.setAttribute('aria-hidden', 'true');
|
||||||
|
dialog.setAttribute('inert', '');
|
||||||
dialog.close();
|
dialog.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user