0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Added visible frame index

This commit is contained in:
Ronald Langeveld 2024-02-21 17:18:08 +02:00
parent 532703a04c
commit b86e11654c

View file

@ -60,8 +60,7 @@ const IframeBuffering: React.FC<IframeBufferingProps> = ({generateContent, class
}, [visibleIframeIndex, iframes]); }, [visibleIframeIndex, iframes]);
useEffect(() => { useEffect(() => {
const invisibleIframeIndex = visibleIframeIndex === 0 ? 1 : 0; const iframe = iframes[visibleIframeIndex].current;
const iframe = iframes[invisibleIframeIndex].current;
if (iframe) { if (iframe) {
iframe.contentWindow?.scrollTo(0, scrollPosition); iframe.contentWindow?.scrollTo(0, scrollPosition);