surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.12k stars 802 forks source link

Dynamic Matrix: Setting 0 as a default value for the `rowCount` property doesn't work as expected #8258

Closed andrewtelnov closed 4 months ago

andrewtelnov commented 4 months ago

The following code doesn't work correctly:

  Serializer.findProperty("matrixdynamic", "rowCount").defaultValue = 0;
  const survey = new SurveyModel({
    elements: [
      {
        type: "matrixdynamic",
        name: "matrix",
        columns: [{ name: "col1" }]
      }
    ]
  });
  survey.data = { matrix: [{ col1: 1 }] };
  //matrix has empty visible rows