From 5a2917855e79740b6490e279a4d71959c53ed424 Mon Sep 17 00:00:00 2001 From: mama Date: Wed, 25 Oct 2017 13:54:41 +0200 Subject: [PATCH] =?UTF-8?q?:bug:=20R=C3=A9paration=20du=20probl=C3=A8me=20?= =?UTF-8?q?sur=20chrome=20du=20chevauchement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/components/Results.js | 7 ++++++- source/containers/Layout.js | 8 +------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/source/components/Results.js b/source/components/Results.js index 4942d4988..e4615fb1e 100644 --- a/source/components/Results.js +++ b/source/components/Results.js @@ -21,6 +21,11 @@ import RuleValueVignette from './rule/RuleValueVignette' }) ) export default class Results extends Component { + componentDidMount(){ + setTimeout(() => + this.props.setElementHeight(this.el.offsetHeight) + , 1) + } render() { let { analysedSituation, @@ -36,7 +41,7 @@ export default class Results extends Component { let onRulePage = R.contains('/regle/')(location.pathname) return ( -
+
this.el = el} id="results" className={classNames({show: showResults})}> {onRulePage && conversationStarted ?
diff --git a/source/containers/Layout.js b/source/containers/Layout.js index 63591e561..6619c3b3a 100644 --- a/source/containers/Layout.js +++ b/source/containers/Layout.js @@ -28,12 +28,6 @@ export default class Layout extends Component { state = { resultsHeight: 600 } - componentDidMount(){ - let resultsEl = document.getElementById('results') - this.setState({ - resultsHeight: resultsEl ? resultsEl.clientHeight : 600 - }) - } render() { let displayWarning = ["/simu/", "/regle/", "/regles"].find( t => window.location.href.toString().indexOf(t) > -1 @@ -71,7 +65,7 @@ export default class Layout extends Component {
- + this.setState({resultsHeight})}/>
)