Potential fix for weird carousel bug on Firefox

This commit is contained in:
Lim Chee Aun 2023-12-05 13:02:52 +08:00
parent 222786f202
commit 66746eb579
2 changed files with 16 additions and 0 deletions

View file

@ -1121,6 +1121,11 @@ a[href^='http'][rel*='nofollow']:visited:not(:has(div)) {
flex-grow: 1; flex-grow: 1;
background-color: var(--backdrop-solid-color); background-color: var(--backdrop-solid-color);
animation: appear 0.3s var(--timing-function) both; animation: appear 0.3s var(--timing-function) both;
transition: width 0.3s var(--timing-function);
&:only-child {
width: 100%;
}
} }
.media-modal-container.loading { .media-modal-container.loading {
display: flex; display: flex;

View file

@ -142,6 +142,17 @@ function StatusPage(params) {
} }
}, [showMediaOnly, closeLink, snapStates.prevLocation]); }, [showMediaOnly, closeLink, snapStates.prevLocation]);
useEffect(() => {
let timer = setTimeout(() => {
// carouselRef.current?.focus?.();
const $carousel = document.querySelector('.carousel');
if ($carousel) {
$carousel.focus();
}
}, 100);
return () => clearTimeout(timer);
}, [showMediaOnly]);
return ( return (
<div class="deck-backdrop"> <div class="deck-backdrop">
{showMedia ? ( {showMedia ? (