surveyjs / surveyjs_react_quickstart

SurveyJS + React Quickstart Template
http://surveyjs.io
140 stars 78 forks source link

Next button doesn't work #9

Closed lucasharada closed 5 years ago

lucasharada commented 5 years ago

I tried copying all the code from this quickstart (v1.0.55), but even though the survey appears and the callback passed to onValueChanged works properly, I can't manage to go to the next page.

Whenever I click the button, it does all validation, but it stops there.

Related code:

import * as Survey from 'survey-react';
import 'survey-react/survey.css';

[...]
render() {
    const { processing, assessment } = this.props;
    if (isEmpty(assessment)) return null;

    const {
      fields: { assessment: assessmentObject },
    } = assessment.items[0];

    const model = new Survey.Model(JSON.parse(assessmentObject.json));
    console.log(JSON.parse(assessmentObject.json));

    return (
      <div>
        <Helmet>
          <title>Survey Test</title>
          <meta name="description" content="Survey Test" />
        </Helmet>
        <AppContainer>
          <LoadingOverlay show={processing} />
          <Grid item xs={12}>
            <Header data={assessment} />
          </Grid>
          <Grid item xs={12}>
            <div className="surveyjs">
              <Survey.Survey
                model={model}
                onComplete={this.onComplete}
                onValueChanged={this.onValueChanged}
              />
            </div>
          </Grid>
        </AppContainer>
      </div>
    );
  }
lucasharada commented 5 years ago

Got to work using version 1.0.53.

dmitry-kurmanov commented 5 years ago

@lucasharada hello, thank you for the reporting. Could you please provide a json to reproduce the problem? The code you've provided above doesn't help with reproducing I think.

duplicate of https://github.com/surveyjs/surveyjs/issues/1437