diff --git a/source/components/ui/index.css b/source/components/ui/index.css index 0bb0e5c72..e021ed13c 100644 --- a/source/components/ui/index.css +++ b/source/components/ui/index.css @@ -7,8 +7,8 @@ } html:fullscreen { background-color: white; + overflow: auto !important; } - body { overflow-x: hidden !important; } diff --git a/source/components/utils/DisableScroll.js b/source/components/utils/DisableScroll.js new file mode 100644 index 000000000..a3f9dc940 --- /dev/null +++ b/source/components/utils/DisableScroll.js @@ -0,0 +1,14 @@ +import { Component } from 'react' + +export default class DisableScroll extends Component { + componentDidMount() { + console.log(document.documentElement) + document.documentElement.style.overflow = 'hidden' + } + componentWillUnmount() { + document.documentElement.style.overflow = '' + } + render() { + return null + } +} diff --git a/source/sites/embauche.gouv.fr/App.js b/source/sites/embauche.gouv.fr/App.js index 8381cc856..77f2dc8f8 100644 --- a/source/sites/embauche.gouv.fr/App.js +++ b/source/sites/embauche.gouv.fr/App.js @@ -1,5 +1,6 @@ import Mecanisms from 'Components/Mecanisms' import RulePage from 'Components/RulePage' +import DisableScroll from 'Components/utils/DisableScroll' import TrackPageView from 'Components/utils/TrackPageView' import React, { Component } from 'react' import { Redirect, Route, Switch } from 'react-router-dom' @@ -33,6 +34,7 @@ class EmbaucheRoute extends Component { onStoreCreated={persistSimulation}> {!inIframe() &&
} + {inIframe() && }