From b86e11654c787caf5477ee068e05e4013d2c128b Mon Sep 17 00:00:00 2001 From: Ronald Langeveld Date: Wed, 21 Feb 2024 17:18:08 +0200 Subject: [PATCH] Added visible frame index --- apps/admin-x-settings/src/utils/IframeBuffering.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/admin-x-settings/src/utils/IframeBuffering.tsx b/apps/admin-x-settings/src/utils/IframeBuffering.tsx index 0e7b3c136a..d3860ca0d7 100644 --- a/apps/admin-x-settings/src/utils/IframeBuffering.tsx +++ b/apps/admin-x-settings/src/utils/IframeBuffering.tsx @@ -60,8 +60,7 @@ const IframeBuffering: React.FC = ({generateContent, class }, [visibleIframeIndex, iframes]); useEffect(() => { - const invisibleIframeIndex = visibleIframeIndex === 0 ? 1 : 0; - const iframe = iframes[invisibleIframeIndex].current; + const iframe = iframes[visibleIframeIndex].current; if (iframe) { iframe.contentWindow?.scrollTo(0, scrollPosition);