1
0
Fork 0

Increase timeout, but such hacky sadly

This commit is contained in:
Lim Chee Aun 2023-08-14 21:39:53 +08:00
parent fe8eb74242
commit e3c77cb516

View file

@ -246,8 +246,10 @@ function MediaModal({
behavior: 'smooth',
});
setTimeout(() => {
carouselRef.current.focus();
}, 100);
// Delay is needed for Safari, the focus stops it from scrolling
// 1000 is hypothetical
carouselRef.current?.focus();
}, 1000);
}}
>
<Icon icon="arrow-left" />
@ -264,8 +266,10 @@ function MediaModal({
behavior: 'smooth',
});
setTimeout(() => {
carouselRef.current.focus();
}, 100);
// Delay is needed for Safari, the focus stops it from scrolling
// 1000 is hypothetical
carouselRef.current?.focus();
}, 1000);
}}
>
<Icon icon="arrow-right" />