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