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 })