Test using inert to control text searchability

pull/543/head
Lim Chee Aun 2024-05-19 16:26:15 +08:00
rodzic ced4dc86aa
commit bdd238de0e
2 zmienionych plików z 30 dodań i 0 usunięć

Wyświetl plik

@ -41,6 +41,24 @@ function Modal({ children, onClose, onClick, class: className }) {
);
useCloseWatcher(onClose, [onClose]);
useEffect(() => {
const $deckContainers = document.querySelectorAll('.deck-container');
if (children) {
$deckContainers.forEach(($deckContainer) => {
$deckContainer.setAttribute('inert', '');
});
} else {
$deckContainers.forEach(($deckContainer) => {
$deckContainer.removeAttribute('inert');
});
}
return () => {
$deckContainers.forEach(($deckContainer) => {
$deckContainer.removeAttribute('inert');
});
};
}, [children]);
const Modal = (
<div
ref={(node) => {

Wyświetl plik

@ -153,6 +153,18 @@ function StatusPage(params) {
return () => clearTimeout(timer);
}, [showMediaOnly]);
useEffect(() => {
const $deckContainers = document.querySelectorAll('.deck-container');
$deckContainers.forEach(($deckContainer) => {
$deckContainer.setAttribute('inert', '');
});
return () => {
$deckContainers.forEach(($deckContainer) => {
$deckContainer.removeAttribute('inert');
});
};
}, []);
return (
<div class="deck-backdrop">
{showMedia ? (