From 809b2cad5eeb142d49af9977b0eff966e1a0566e Mon Sep 17 00:00:00 2001
From: Johan Girod
Date: Mon, 6 Aug 2018 14:26:53 +0200
Subject: [PATCH] =?UTF-8?q?[infrance]=20scroll=20pour=20faire=20apparaitre?=
=?UTF-8?q?=20la=20r=C3=A9partitions=20des=20cotisations=20lors=20de=20la?=
=?UTF-8?q?=20premi=C3=A8re=20saisie=20du=20salaire?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
source/components/Simu.js | 6 +++++-
source/components/conversation/Conversation.js | 6 +++---
source/components/utils/Scroll.js | 2 ++
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/source/components/Simu.js b/source/components/Simu.js
index fd4e18bd1..96c86dbc9 100644
--- a/source/components/Simu.js
+++ b/source/components/Simu.js
@@ -1,4 +1,5 @@
import { startConversation } from 'Actions/actions'
+import { ScrollToElement } from 'Components/utils/Scroll'
import withColours from 'Components/utils/withColours'
import withLanguage from 'Components/utils/withLanguage'
import React, { Component } from 'react'
@@ -69,6 +70,7 @@ export default class Simu extends Component {
)}
+ {firstValidInputEntered && }
-
diff --git a/source/components/conversation/Conversation.js b/source/components/conversation/Conversation.js
index 1e41f78e6..41f2319ec 100644
--- a/source/components/conversation/Conversation.js
+++ b/source/components/conversation/Conversation.js
@@ -1,4 +1,4 @@
-import { ScrollToElement } from 'Components/utils/Scroll'
+import Scroll from 'Components/utils/Scroll'
import { getInputComponent } from 'Engine/generateQuestions'
import React, { Component } from 'react'
import { translate } from 'react-i18next'
@@ -30,10 +30,10 @@ export default class Conversation extends Component {
return (
-
+
+
{currentQuestion && (
-
{getInputComponent(flatRules, targetNames)(currentQuestion)}
)}
diff --git a/source/components/utils/Scroll.js b/source/components/utils/Scroll.js
index 218e81c1a..1d30e7163 100644
--- a/source/components/utils/Scroll.js
+++ b/source/components/utils/Scroll.js
@@ -5,6 +5,7 @@ export class ScrollToTop extends Component {
behavior: 'auto'
}
componentDidMount() {
+ console.log('scrototop')
window.scroll({
top: 0,
behavior: this.props.behavior
@@ -27,6 +28,7 @@ export class ScrollToElement extends Component {
) {
return
}
+ console.log('scrotoelem')
this.ref.scrollIntoView({
behavior: this.props.behavior
})