survey-creator-react 3.2.0 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-creator-react",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "description": "Embeddable SurveyJS drag-and-drop form builder for JSON-based forms in React. Create dynamic surveys, polls, quizzes, and other forms, configure conditional logic and validation, and customize the editor UI.",
5
5
  "author": "DevSoft Baltic OU <info@devsoftbaltic.com>",
6
6
  "homepage": "https://surveyjs.io/",
@@ -67,9 +67,9 @@
67
67
  "ace-builds": "^1.4.12",
68
68
  "react": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0",
69
69
  "react-dom": "^16.5.0 || ^17.0.1 || ^18.1.0 || ^19.0.0",
70
- "survey-core": "3.2.0",
71
- "survey-react-ui": "3.2.0",
72
- "survey-creator-core": "3.2.0"
70
+ "survey-core": "3.2.2",
71
+ "survey-react-ui": "3.2.2",
72
+ "survey-creator-core": "3.2.2"
73
73
  },
74
74
  "peerDependenciesMeta": {
75
75
  "ace-builds": {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * SurveyJS Creator v3.2.0
2
+ * SurveyJS Creator v3.2.2
3
3
  * (c) 2015-2026 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * Github: https://github.com/surveyjs/survey-creator
5
5
  * License: https://surveyjs.io/Licenses#SurveyCreator
@@ -685,6 +685,9 @@
685
685
 
686
686
  class QuestionRatingAdornerComponent extends CreatorModelElement {
687
687
  createModel(props) {
688
+ if (this.modelValue && !this.modelValue.isDisposed) {
689
+ this.modelValue.dispose();
690
+ }
688
691
  this.modelValue = this.createQuestionViewModel(props);
689
692
  }
690
693
  createQuestionViewModel(props) {
@@ -702,6 +705,19 @@
702
705
  getStateElement() {
703
706
  return this.model;
704
707
  }
708
+ componentDidMount() {
709
+ // React StrictMode mounts the same component again after
710
+ // componentWillUnmount disposed its model.
711
+ if (this.modelValue.isDisposed) {
712
+ this.createModel(this.props);
713
+ this.forceUpdate();
714
+ }
715
+ super.componentDidMount();
716
+ }
717
+ componentWillUnmount() {
718
+ super.componentWillUnmount();
719
+ this.modelValue.dispose();
720
+ }
705
721
  renderElement() {
706
722
  const model = this.ratingModel;
707
723
  return (React__namespace.createElement(React__namespace.Fragment, null,
@@ -1138,6 +1154,9 @@
1138
1154
  this.rootRef = React__namespace.createRef();
1139
1155
  }
1140
1156
  createModel(props) {
1157
+ if (this.model && !this.model.isDisposed) {
1158
+ this.model.dispose();
1159
+ }
1141
1160
  this.model = new surveyCreatorCore.ItemValueWrapperViewModel(props.componentData.creator, props.question, props.item);
1142
1161
  }
1143
1162
  getUpdatedModelProps() {
@@ -1154,12 +1173,19 @@
1154
1173
  }
1155
1174
  }
1156
1175
  componentDidMount() {
1176
+ // React StrictMode mounts the same component again after
1177
+ // componentWillUnmount disposed its model.
1178
+ if (this.model.isDisposed) {
1179
+ this.createModel(this.props);
1180
+ this.forceUpdate();
1181
+ }
1157
1182
  super.componentDidMount();
1158
1183
  this.props.item.setRootElement(this.rootRef.current);
1159
1184
  }
1160
1185
  componentWillUnmount() {
1161
1186
  super.componentWillUnmount();
1162
1187
  this.props.item.setRootElement(undefined);
1188
+ this.model.dispose();
1163
1189
  }
1164
1190
  renderButton(action) {
1165
1191
  return surveyReactUi.ReactElementFactory.Instance.createElement("sv-action-bar-item", {
@@ -1218,6 +1244,9 @@
1218
1244
  this.rootRef = React__namespace.createRef();
1219
1245
  }
1220
1246
  createModel(props) {
1247
+ if (this.model && !this.model.isDisposed) {
1248
+ this.model.dispose();
1249
+ }
1221
1250
  this.model = new surveyCreatorCore.ImageItemValueWrapperViewModel(props.componentData.creator, props.question, props.item, null, null);
1222
1251
  }
1223
1252
  getUpdatedModelProps() {
@@ -1230,6 +1259,12 @@
1230
1259
  return this.props.question;
1231
1260
  }
1232
1261
  componentDidMount() {
1262
+ // React StrictMode mounts the same component again after
1263
+ // componentWillUnmount disposed its model.
1264
+ if (this.model.isDisposed) {
1265
+ this.createModel(this.props);
1266
+ this.forceUpdate();
1267
+ }
1233
1268
  super.componentDidMount();
1234
1269
  this.model.itemsRoot = this.rootRef.current;
1235
1270
  }
@@ -1237,6 +1272,10 @@
1237
1272
  super.componentDidUpdate(prevProps, prevState);
1238
1273
  this.model.itemsRoot = this.rootRef.current;
1239
1274
  }
1275
+ componentWillUnmount() {
1276
+ super.componentWillUnmount();
1277
+ this.model.dispose();
1278
+ }
1240
1279
  renderLoadingIndicator() {
1241
1280
  return React__namespace.createElement("div", { className: "svc-image-item-value__loading" },
1242
1281
  React__namespace.createElement(surveyReactUi.LoadingIndicatorComponent, null));
@@ -2439,7 +2478,7 @@
2439
2478
  clearCallback(page) {
2440
2479
  if (!page)
2441
2480
  return;
2442
- page.unRegisterFunctionOnPropertyValueChanged("name");
2481
+ page.unRegisterFunctionOnPropertyValueChanged("name", this.id);
2443
2482
  }
2444
2483
  componentDidUpdate(prevProps, prevState) {
2445
2484
  if (prevProps.page !== this.props.page) {
@@ -3176,8 +3215,8 @@
3176
3215
  });
3177
3216
 
3178
3217
  exports.Version = void 0;
3179
- exports.Version = `${"3.2.0"}`;
3180
- surveyCore.checkLibraryVersion(`${"3.2.0"}`, "survey-creator-react");
3218
+ exports.Version = `${"3.2.2"}`;
3219
+ surveyCore.checkLibraryVersion(`${"3.2.2"}`, "survey-creator-react");
3181
3220
 
3182
3221
  Object.defineProperty(exports, "PropertyGridEditorCollection", {
3183
3222
  enumerable: true,