From 4632ddb2159988d16a16c27002e65b2525bf1806 Mon Sep 17 00:00:00 2001 From: Maxime Quandalle Date: Fri, 7 May 2021 14:52:06 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Cache=20la=20barre=20de=20d?= =?UTF-8?q?=C3=A9filement=20des=20iframes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #1462 --- mon-entreprise/source/pages/Iframes/index.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mon-entreprise/source/pages/Iframes/index.tsx b/mon-entreprise/source/pages/Iframes/index.tsx index 3aac548d8..e5350bc58 100644 --- a/mon-entreprise/source/pages/Iframes/index.tsx +++ b/mon-entreprise/source/pages/Iframes/index.tsx @@ -1,4 +1,5 @@ import { IsEmbeddedContext } from 'Components/utils/embeddedContext' +import { useEffect } from 'react' import { Helmet } from 'react-helmet' import { Route, Switch } from 'react-router-dom' import useSimulatorsData from '../Simulateurs/metadata' @@ -8,6 +9,14 @@ import IframeFooter from './IframeFooter' export default function Iframes() { const simulators = useSimulatorsData() + // We hide the vertical scrollbar in the iframe because the iframe is resized + // using the "iframe-resizer" module, and if we keep the scrollbar it appears + // briefly during transitions, cf. + // https://github.com/betagouv/mon-entreprise/issues/1462 + useEffect(() => { + document.body.style.overflowY = 'hidden' + }, []) + return ( {/** Open external links in the parent frame.