0

hi im using the surveyjs to create my react survey and there is a question type that i need which is custom widget:Select2 tagbox questiontype but nothing i try works. has anyone been able to solve this even when i change the "type" to "celltype" that does not work either and i cant figure out what could be the problem. if anyone is able to assist it would be much appreciated.

here is my code below.

import React,{Component} from 'react';
import './App.css';
import "survey-react/survey.css"
import * as Survey from "survey-react"
import "surveyjs-widgets"

class App extends Component {
    constructor (props){
        super(props)
        this.state = {

    }

        this.onCompleteComponent = this.onCompleteComponent.bind(this)
    }
    onCompleteComponent = () =>{
        this.setState({
            isCompleted: true
         })
    }



render(){
var json = {
  clearInvisibleValues: "onHidden",
  questions: [
      { //question 1
          type: "tagbox",
          name: "roles",
          title: "Roles with non-portable work",
          choices: [
              "Role1",
              "Role2",
              "Role3"
          ],
          colCount: 0
      }
   };
   ]
  };

var surveyRender= !this.state.isCompleted ? (
    <Survey.Survey
    json={json}
    showCompletedPage={false}
    onComplete={this.onCompleteComponent}
    />
 ) : null

var onSurveyCompletion = this.state.isCompleted?(
    <div>Thank you for your participation in this survey!</div>
 ) : null;

 return (
    <div className="App">
      <div>
          {surveyRender}
          {onSurveyCompletion}
      </div>
    </div>
     );
   }
 }
export default App;
  • Here is the live sample - https://surveyjs.io/Examples/Library?id=custom-widget-select2-tagbox&platform=Reactjs&theme=modern – TSV Jul 12 '20 at 09:09
  • im aware of the example it does not work – Never2Nervous Jul 13 '20 at 17:51
  • It works as on our site as well in the react quick start demo repo - https://github.com/surveyjs/surveyjs_react_quickstart . If it doesn't work please provide us with a minimal live sample to reproduce the issue (please read the https://stackoverflow.com/help/minimal-reproducible-example article how to create a sample) – TSV Jul 14 '20 at 08:47

0 Answers0