survey-react 1.12.26 → 1.12.27

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/defaultV2.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.26
2
+ * surveyjs - Survey JavaScript library v1.12.27
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/defaultV2.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.26
2
+ * surveyjs - Survey JavaScript library v1.12.27
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/modern.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.26
2
+ * surveyjs - Survey JavaScript library v1.12.27
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/modern.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.26
2
+ * surveyjs - Survey JavaScript library v1.12.27
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "survey-react",
3
- "version": "1.12.26",
3
+ "version": "1.12.27",
4
4
  "description": "survey.js is a JavaScript Survey Library. It is a modern way to add a survey to your website. It uses JSON for survey metadata and results.",
5
5
  "keywords": [
6
6
  "Survey",
package/survey.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.26
2
+ * surveyjs - Survey JavaScript library v1.12.27
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/survey.min.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.26
2
+ * surveyjs - Survey JavaScript library v1.12.27
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
package/survey.react.d.ts CHANGED
@@ -9064,6 +9064,7 @@ declare module "packages/survey-core/src/mask/input_element_adapter" {
9064
9064
  private inputMaskInstance;
9065
9065
  private inputElement;
9066
9066
  private prevUnmaskedValue;
9067
+ private setInputValue;
9067
9068
  constructor(inputMaskInstance: InputMaskBase, inputElement: HTMLInputElement, value?: any);
9068
9069
  inputMaskInstancePropertyChangedHandler: (sender: any, options: any) => void;
9069
9070
  clickHandler: (event: any) => void;
@@ -12292,6 +12293,7 @@ declare module "packages/survey-core/src/survey" {
12292
12293
  * @see getQuestionByName
12293
12294
  */
12294
12295
  getAllQuestions(visibleOnly?: boolean, includeDesignTime?: boolean, includeNested?: boolean): Array<Question>;
12296
+ private getNestedQuestionsByQuestionArray;
12295
12297
  /**
12296
12298
  * Returns an array of quiz questions. A question counts if it is visible, has an input field, and specifies [`correctAnswer`](https://surveyjs.io/form-library/documentation/api-reference/checkbox-question-model#correctAnswer).
12297
12299
  *
@@ -13506,6 +13508,7 @@ declare module "packages/survey-core/src/question" {
13506
13508
  get visible(): boolean;
13507
13509
  set visible(val: boolean);
13508
13510
  protected onVisibleChanged(): void;
13511
+ private onVisibleChangedCore;
13509
13512
  protected notifyStateChanged(prevState: string): void;
13510
13513
  updateElementVisibility(): void;
13511
13514
  private updateIsVisibleProp;
@@ -13603,11 +13606,12 @@ declare module "packages/survey-core/src/question" {
13603
13606
  private setValueExpressionRunner;
13604
13607
  private ensureSetValueExpressionRunner;
13605
13608
  private runSetValueExpression;
13606
- private checkExpressionIf;
13609
+ private getSetValueExpressionRunner;
13607
13610
  private triggersInfo;
13608
13611
  private addTriggerInfo;
13609
13612
  private runTriggerInfo;
13610
13613
  private canExecuteTriggerByKeys;
13614
+ private canExecuteTriggerByKeysCore;
13611
13615
  runTriggers(name: string, value: any, keys?: any): void;
13612
13616
  private runConditions;
13613
13617
  setSurveyImpl(value: ISurveyImpl, isLight?: boolean): void;
@@ -28096,12 +28100,15 @@ declare module "packages/survey-react-ui/src/reactquestion_element" {
28096
28100
  protected get changedStatePropName(): string | undefined;
28097
28101
  private makeBaseElementsReact;
28098
28102
  private unMakeBaseElementsReact;
28103
+ private unMakeBaseElementsReactive;
28099
28104
  protected disableStateElementsRerenderEvent(els: Array<Base>): void;
28100
28105
  protected getStateElements(): Array<Base>;
28101
28106
  protected getStateElement(): Base | null;
28102
28107
  protected get isDisplayMode(): boolean;
28103
28108
  protected renderLocString(locStr: LocalizableString, style?: any, key?: string): React.JSX.Element;
28104
28109
  private canMakeReact;
28110
+ private propertyValueChangedHandler;
28111
+ protected isCurrentStateElement(stateElement: Base): boolean;
28105
28112
  private makeBaseElementReact;
28106
28113
  protected canUsePropInState(key: string): boolean;
28107
28114
  private unMakeBaseElementReact;
package/survey.react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * surveyjs - Survey JavaScript library v1.12.26
2
+ * surveyjs - Survey JavaScript library v1.12.27
3
3
  * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
4
  * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
5
  */
@@ -14833,6 +14833,9 @@ var survey_element_SurveyElement = /** @class */ (function (_super) {
14833
14833
  configurable: true
14834
14834
  });
14835
14835
  SurveyElement.prototype.canHaveFrameStyles = function () {
14836
+ var _a;
14837
+ if (((_a = this.survey) === null || _a === void 0 ? void 0 : _a.currentSingleQuestion) === this)
14838
+ return true;
14836
14839
  return (this.parent !== undefined && (!this.hasParent || this.parent && this.parent.showPanelAsPage));
14837
14840
  };
14838
14841
  SurveyElement.prototype.getHasFrameV2 = function () {
@@ -18957,7 +18960,7 @@ var TriggerExpressionInfo = /** @class */ (function () {
18957
18960
  this.name = name;
18958
18961
  this.canRun = canRun;
18959
18962
  this.doComplete = doComplete;
18960
- this.runSecondCheck = function (keys) { return false; };
18963
+ this.getSecondRunner = function () { return undefined; };
18961
18964
  }
18962
18965
  return TriggerExpressionInfo;
18963
18966
  }());
@@ -19006,7 +19009,7 @@ var question_Question = /** @class */ (function (_super) {
19006
19009
  _this.finishSetValueOnExpression();
19007
19010
  });
19008
19011
  var setValueIfInfo = _this.addTriggerInfo("setValueIf", function () { return true; }, function () { return _this.runSetValueExpression(); });
19009
- setValueIfInfo.runSecondCheck = function (keys) { return _this.checkExpressionIf(keys); };
19012
+ setValueIfInfo.getSecondRunner = function () { return _this.getSetValueExpressionRunner(); };
19010
19013
  _this.registerPropertyChangedHandlers(["width"], function () {
19011
19014
  _this.updateQuestionCss();
19012
19015
  if (!!_this.parent) {
@@ -19312,13 +19315,21 @@ var question_Question = /** @class */ (function (_super) {
19312
19315
  if (val == this.visible)
19313
19316
  return;
19314
19317
  this.setPropertyValue("visible", val);
19315
- this.onVisibleChanged();
19318
+ this.onVisibleChangedCore();
19316
19319
  this.notifySurveyVisibilityChanged();
19317
19320
  },
19318
19321
  enumerable: false,
19319
19322
  configurable: true
19320
19323
  });
19321
19324
  Question.prototype.onVisibleChanged = function () {
19325
+ var prevVal = this.getPropertyValue("isVisible");
19326
+ this.onVisibleChangedCore();
19327
+ var newVal = this.getPropertyValue("isVisible");
19328
+ if (prevVal !== undefined && prevVal !== newVal) {
19329
+ this.notifySurveyVisibilityChanged();
19330
+ }
19331
+ };
19332
+ Question.prototype.onVisibleChangedCore = function () {
19322
19333
  this.updateIsVisibleProp();
19323
19334
  if (!this.isVisible && this.errors && this.errors.length > 0) {
19324
19335
  this.errors = [];
@@ -19533,11 +19544,9 @@ var question_Question = /** @class */ (function (_super) {
19533
19544
  this.setValueExpressionRunner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());
19534
19545
  }
19535
19546
  };
19536
- Question.prototype.checkExpressionIf = function (keys) {
19547
+ Question.prototype.getSetValueExpressionRunner = function () {
19537
19548
  this.ensureSetValueExpressionRunner();
19538
- if (!this.setValueExpressionRunner)
19539
- return false;
19540
- return this.canExecuteTriggerByKeys(keys, this.setValueExpressionRunner);
19549
+ return this.setValueExpressionRunner;
19541
19550
  };
19542
19551
  Question.prototype.addTriggerInfo = function (name, canRun, doComplete) {
19543
19552
  var info = new TriggerExpressionInfo(name, canRun, doComplete);
@@ -19546,10 +19555,7 @@ var question_Question = /** @class */ (function (_super) {
19546
19555
  };
19547
19556
  Question.prototype.runTriggerInfo = function (info, keys) {
19548
19557
  var expression = this[info.name];
19549
- if (!expression || info.isRunning || !info.canRun()) {
19550
- if (info.runSecondCheck(keys)) {
19551
- info.doComplete();
19552
- }
19558
+ if (!expression && !info.getSecondRunner() || info.isRunning || !info.canRun()) {
19553
19559
  return;
19554
19560
  }
19555
19561
  if (!info.runner) {
@@ -19564,16 +19570,35 @@ var question_Question = /** @class */ (function (_super) {
19564
19570
  else {
19565
19571
  info.runner.expression = expression;
19566
19572
  }
19567
- if (!this.canExecuteTriggerByKeys(keys, info.runner) && !info.runSecondCheck(keys))
19573
+ if (!this.canExecuteTriggerByKeys(keys, info.runner, info.getSecondRunner()))
19568
19574
  return;
19569
19575
  info.isRunning = true;
19570
- info.runner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());
19576
+ if (!expression && info.getSecondRunner()) {
19577
+ info.doComplete();
19578
+ info.isRunning = false;
19579
+ }
19580
+ else {
19581
+ info.runner.run(this.getDataFilteredValues(), this.getDataFilteredProperties());
19582
+ }
19583
+ };
19584
+ Question.prototype.canExecuteTriggerByKeys = function (keys, runner, secondRunner) {
19585
+ if (!runner && !!secondRunner) {
19586
+ runner = secondRunner;
19587
+ secondRunner = undefined;
19588
+ }
19589
+ var run1 = this.canExecuteTriggerByKeysCore(keys, runner);
19590
+ if (run1 === "var")
19591
+ return true;
19592
+ if (!secondRunner)
19593
+ return run1 === "func";
19594
+ var run2 = this.canExecuteTriggerByKeysCore(keys, secondRunner);
19595
+ return run2 !== "";
19571
19596
  };
19572
- Question.prototype.canExecuteTriggerByKeys = function (keys, runner) {
19597
+ Question.prototype.canExecuteTriggerByKeysCore = function (keys, runner) {
19573
19598
  var vars = runner.getVariables();
19574
19599
  if ((!vars || vars.length === 0) && runner.hasFunction())
19575
- return true;
19576
- return new conditionProcessValue_ProcessValue().isAnyKeyChanged(keys, vars);
19600
+ return "func";
19601
+ return new conditionProcessValue_ProcessValue().isAnyKeyChanged(keys, vars) ? "var" : "";
19577
19602
  };
19578
19603
  Question.prototype.runTriggers = function (name, value, keys) {
19579
19604
  var _this = this;
@@ -19950,11 +19975,8 @@ var question_Question = /** @class */ (function (_super) {
19950
19975
  });
19951
19976
  Object.defineProperty(Question.prototype, "renderedCommentPlaceholder", {
19952
19977
  get: function () {
19953
- var _this = this;
19954
- var func = function () {
19955
- return !_this.isReadOnly ? _this.commentPlaceHolder : undefined;
19956
- };
19957
- return this.getPropertyValue("renderedCommentPlaceholder", undefined, func);
19978
+ var _a;
19979
+ return (_a = this.getPropertyValue("renderedCommentPlaceholder")) !== null && _a !== void 0 ? _a : (!this.isReadOnly ? this.commentPlaceHolder : undefined);
19958
19980
  },
19959
19981
  enumerable: false,
19960
19982
  configurable: true
@@ -26545,17 +26567,17 @@ Serializer.addClass("expression", [
26545
26567
  { name: "minimumFractionDigits:number", default: -1 },
26546
26568
  { name: "useGrouping:boolean", default: true },
26547
26569
  { name: "precision:number", default: -1, category: "data" },
26548
- { name: "enableIf", visible: false },
26549
- { name: "isRequired", visible: false },
26550
- { name: "readOnly", visible: false },
26551
- { name: "requiredErrorText", visible: false },
26552
- { name: "resetValueIf", visible: false },
26553
- { name: "setValueIf", visible: false },
26554
- { name: "setValueExpression", visible: false },
26555
- { name: "defaultValueExpression", visible: false },
26556
- { name: "defaultValue", visible: false },
26557
- { name: "correctAnswer", visible: false },
26558
- { name: "requiredIf", visible: false }
26570
+ { name: "enableIf", visible: false, isSerializable: false },
26571
+ { name: "isRequired", visible: false, isSerializable: false },
26572
+ { name: "readOnly", visible: false, isSerializable: false },
26573
+ { name: "requiredErrorText", visible: false, isSerializable: false },
26574
+ { name: "resetValueIf", visible: false, isSerializable: false },
26575
+ { name: "setValueIf", visible: false, isSerializable: false },
26576
+ { name: "setValueExpression", visible: false, isSerializable: false },
26577
+ { name: "defaultValueExpression", visible: false, isSerializable: false },
26578
+ { name: "defaultValue", visible: false, isSerializable: false },
26579
+ { name: "correctAnswer", visible: false, isSerializable: false },
26580
+ { name: "requiredIf", visible: false, isSerializable: false }
26559
26581
  ], function () {
26560
26582
  return new question_expression_QuestionExpressionModel("");
26561
26583
  }, "question");
@@ -44774,7 +44796,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
44774
44796
  var q = this.currentSingleQuestion;
44775
44797
  if (!q)
44776
44798
  return this.nextPage();
44777
- if (!q.validate(true))
44799
+ if (this.validationEnabled && !q.validate(true))
44778
44800
  return false;
44779
44801
  var questions = this.getSingleQuestions();
44780
44802
  var index = questions.indexOf(q);
@@ -45064,7 +45086,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45064
45086
  SurveyModel.prototype.fireValidatedErrorsOnPage = function (page) {
45065
45087
  if (this.onValidatedErrorsOnCurrentPage.isEmpty || !page)
45066
45088
  return;
45067
- var questionsOnPage = page.questions;
45089
+ var questionsOnPage = this.getNestedQuestionsByQuestionArray(page.questions, true);
45068
45090
  var questions = new Array();
45069
45091
  var errors = new Array();
45070
45092
  for (var i = 0; i < questionsOnPage.length; i++) {
@@ -45166,7 +45188,7 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45166
45188
  return false;
45167
45189
  }
45168
45190
  this.showPreviewCore();
45169
- return true;
45191
+ return this.isShowingPreview;
45170
45192
  };
45171
45193
  SurveyModel.prototype.showPreviewCore = function () {
45172
45194
  var options = { allowShowPreview: true, allow: true };
@@ -45186,6 +45208,11 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45186
45208
  return;
45187
45209
  this.gotoPageFromPreview = currentPage;
45188
45210
  this.isShowingPreview = false;
45211
+ var q = this.currentSingleQuestion;
45212
+ if (!!(q === null || q === void 0 ? void 0 : q.page)) {
45213
+ q.page.updateRows();
45214
+ this.currentPage = q.page;
45215
+ }
45189
45216
  };
45190
45217
  SurveyModel.prototype.cancelPreviewByPage = function (panel) {
45191
45218
  this.cancelPreview(panel);
@@ -45348,6 +45375,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45348
45375
  rootPage.setSurveyImpl(this);
45349
45376
  this.pageContainerValue = rootPage;
45350
45377
  this.currentPage = rootPage;
45378
+ if (!!this.currentSingleQuestionValue) {
45379
+ this.visiblePages.forEach(function (page) { return page.updateRows(); });
45380
+ }
45351
45381
  }
45352
45382
  if (!this.isSinglePage && !this.isShowingPreview) {
45353
45383
  this.disposeContainerPage();
@@ -45378,13 +45408,18 @@ var survey_SurveyModel = /** @class */ (function (_super) {
45378
45408
  for (var i = 0; i < pages.length; i++) {
45379
45409
  var p = pages[i];
45380
45410
  if (!p.isStartPage && p.isVisible) {
45381
- p.addQuestionsToList(res, true);
45411
+ var qs = [];
45412
+ p.addQuestionsToList(qs, true);
45413
+ qs.forEach(function (q) { if (q.isVisible)
45414
+ res.push(q); });
45382
45415
  }
45383
45416
  }
45384
45417
  return res;
45385
45418
  };
45386
45419
  Object.defineProperty(SurveyModel.prototype, "currentSingleQuestion", {
45387
- get: function () { return this.currentSingleQuestionValue; },
45420
+ get: function () {
45421
+ return !this.isShowingPreview ? this.currentSingleQuestionValue : undefined;
45422
+ },
45388
45423
  set: function (val) {
45389
45424
  var oldVal = this.currentSingleQuestion;
45390
45425
  if (val !== oldVal && !this.isCompleted) {
@@ -46782,6 +46817,9 @@ var survey_SurveyModel = /** @class */ (function (_super) {
46782
46817
  }
46783
46818
  if (!includeNested)
46784
46819
  return res;
46820
+ return this.getNestedQuestionsByQuestionArray(res, visibleOnly);
46821
+ };
46822
+ SurveyModel.prototype.getNestedQuestionsByQuestionArray = function (res, visibleOnly) {
46785
46823
  var res2 = [];
46786
46824
  res.forEach(function (q) {
46787
46825
  res2.push(q);
@@ -55382,7 +55420,7 @@ var InputElementAdapter = /** @class */ (function () {
55382
55420
  this.inputMaskInstancePropertyChangedHandler = function (sender, options) {
55383
55421
  if (options.name !== "saveMaskedValue") {
55384
55422
  var maskedValue = _this.inputMaskInstance.getMaskedValue(_this.prevUnmaskedValue);
55385
- _this.inputElement.value = maskedValue;
55423
+ _this.setInputValue(maskedValue);
55386
55424
  }
55387
55425
  };
55388
55426
  this.clickHandler = function (event) {
@@ -55393,7 +55431,7 @@ var InputElementAdapter = /** @class */ (function () {
55393
55431
  this.beforeInputHandler = function (event) {
55394
55432
  var args = _this.createArgs(event);
55395
55433
  var result = _this.inputMaskInstance.processInput(args);
55396
- _this.inputElement.value = result.value;
55434
+ _this.setInputValue(result.value);
55397
55435
  _this.inputElement.setSelectionRange(result.caretPosition, result.caretPosition);
55398
55436
  if (!result.cancelPreventDefault) {
55399
55437
  event.preventDefault();
@@ -55401,17 +55439,23 @@ var InputElementAdapter = /** @class */ (function () {
55401
55439
  };
55402
55440
  this.changeHandler = function (event) {
55403
55441
  var result = _this.inputMaskInstance.processInput({ prevValue: "", insertedChars: event.target.value, selectionStart: 0, selectionEnd: 0 });
55404
- _this.inputElement.value = result.value;
55442
+ _this.setInputValue(result.value);
55405
55443
  };
55406
55444
  var _value = value;
55407
55445
  if (_value === null || _value === undefined) {
55408
55446
  _value = "";
55409
55447
  }
55410
- this.inputElement.value = inputMaskInstance.getMaskedValue(_value);
55448
+ this.setInputValue(inputMaskInstance.getMaskedValue(_value));
55411
55449
  this.prevUnmaskedValue = _value;
55412
55450
  inputMaskInstance.onPropertyChanged.add(this.inputMaskInstancePropertyChangedHandler);
55413
55451
  this.addInputEventListener();
55414
55452
  }
55453
+ InputElementAdapter.prototype.setInputValue = function (value) {
55454
+ if (this.inputElement.maxLength >= 0 && this.inputElement.maxLength < value.length) {
55455
+ value = value.slice(0, this.inputElement.maxLength);
55456
+ }
55457
+ this.inputElement.value = value;
55458
+ };
55415
55459
  InputElementAdapter.prototype.createArgs = function (event) {
55416
55460
  var args = {
55417
55461
  insertedChars: event.data,
@@ -72281,7 +72325,7 @@ var mask_datetime_InputMaskDateTime = /** @class */ (function (_super) {
72281
72325
  var maxYear = dateTime.max.getFullYear();
72282
72326
  if (checkOnlyLeapYears) {
72283
72327
  minYear = Math.ceil(minYear / 4) * 4;
72284
- maxYear = Math.floor(minYear / 4) * 4;
72328
+ maxYear = Math.floor(maxYear / 4) * 4;
72285
72329
  if (minYear > maxYear) {
72286
72330
  minYear = undefined;
72287
72331
  maxYear = undefined;
@@ -72445,7 +72489,7 @@ var mask_datetime_InputMaskDateTime = /** @class */ (function (_super) {
72445
72489
  var isoMin, isoMax;
72446
72490
  if (this.hasDatePart) {
72447
72491
  isoMin = this.min || "0001-01-01";
72448
- isoMax = this.max || "9999-12-31";
72492
+ isoMax = this.max || "9996-12-31";
72449
72493
  }
72450
72494
  else {
72451
72495
  isoMin = this.defaultDate + (this.min || "00:00:00");
@@ -72798,9 +72842,9 @@ Serializer.addClass("currencymask", [
72798
72842
 
72799
72843
  var Version;
72800
72844
  var ReleaseDate;
72801
- Version = "" + "1.12.26";
72845
+ Version = "" + "1.12.27";
72802
72846
  settings.version = Version;
72803
- ReleaseDate = "" + "2025-03-03";
72847
+ ReleaseDate = "" + "2025-03-12";
72804
72848
  function checkLibraryVersion(ver, libraryName) {
72805
72849
  if (Version != ver) {
72806
72850
  var str = "survey-core has version '" + Version + "' and " + libraryName
@@ -83050,6 +83094,21 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
83050
83094
  var _this = _super.call(this, props) || this;
83051
83095
  _this._allowComponentUpdate = true;
83052
83096
  _this.prevStateElements = [];
83097
+ _this.propertyValueChangedHandler = function (hash, key, val) {
83098
+ if (hash[key] !== val) {
83099
+ hash[key] = val;
83100
+ if (!_this.canUsePropInState(key))
83101
+ return;
83102
+ if (_this.isRendering)
83103
+ return;
83104
+ _this.changedStatePropNameValue = key;
83105
+ _this.setState(function (state) {
83106
+ var newState = {};
83107
+ newState[key] = val;
83108
+ return newState;
83109
+ });
83110
+ }
83111
+ };
83053
83112
  return _this;
83054
83113
  }
83055
83114
  SurveyElementBase.renderLocString = function (locStr, style, key) {
@@ -83158,6 +83217,9 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
83158
83217
  };
83159
83218
  SurveyElementBase.prototype.unMakeBaseElementsReact = function () {
83160
83219
  var els = this.getStateElements();
83220
+ this.unMakeBaseElementsReactive(els);
83221
+ };
83222
+ SurveyElementBase.prototype.unMakeBaseElementsReactive = function (els) {
83161
83223
  for (var i = 0; i < els.length; i++) {
83162
83224
  this.unMakeBaseElementReact(els[i]);
83163
83225
  }
@@ -83189,6 +83251,9 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
83189
83251
  SurveyElementBase.prototype.canMakeReact = function (stateElement) {
83190
83252
  return !!stateElement && !!stateElement.iteratePropertiesHash;
83191
83253
  };
83254
+ SurveyElementBase.prototype.isCurrentStateElement = function (stateElement) {
83255
+ return !!stateElement && !!stateElement.setPropertyValueCoreHandler && stateElement.setPropertyValueCoreHandler === this.propertyValueChangedHandler;
83256
+ };
83192
83257
  SurveyElementBase.prototype.makeBaseElementReact = function (stateElement) {
83193
83258
  var _this = this;
83194
83259
  if (!this.canMakeReact(stateElement))
@@ -83211,21 +83276,7 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
83211
83276
  };
83212
83277
  }
83213
83278
  });
83214
- stateElement.setPropertyValueCoreHandler = function (hash, key, val) {
83215
- if (hash[key] !== val) {
83216
- hash[key] = val;
83217
- if (!_this.canUsePropInState(key))
83218
- return;
83219
- if (_this.isRendering)
83220
- return;
83221
- _this.changedStatePropNameValue = key;
83222
- _this.setState(function (state) {
83223
- var newState = {};
83224
- newState[key] = val;
83225
- return newState;
83226
- });
83227
- }
83228
- };
83279
+ stateElement.setPropertyValueCoreHandler = this.propertyValueChangedHandler;
83229
83280
  };
83230
83281
  SurveyElementBase.prototype.canUsePropInState = function (key) {
83231
83282
  return true;
@@ -83233,6 +83284,11 @@ var reactquestion_element_SurveyElementBase = /** @class */ (function (_super) {
83233
83284
  SurveyElementBase.prototype.unMakeBaseElementReact = function (stateElement) {
83234
83285
  if (!this.canMakeReact(stateElement))
83235
83286
  return;
83287
+ if (!this.isCurrentStateElement(stateElement)) {
83288
+ // eslint-disable-next-line no-console
83289
+ // console.warn("Looks like the component is bound to another survey element. It is not supported and can lead to issues.");
83290
+ // return;
83291
+ }
83236
83292
  stateElement.setPropertyValueCoreHandler = undefined;
83237
83293
  stateElement.iteratePropertiesHash(function (hash, key) {
83238
83294
  var val = hash[key];
@@ -83636,8 +83692,10 @@ var row_SurveyRow = /** @class */ (function (_super) {
83636
83692
  };
83637
83693
  SurveyRow.prototype.componentWillUnmount = function () {
83638
83694
  _super.prototype.componentWillUnmount.call(this);
83639
- this.row.setRootElement(undefined);
83640
- this.stopLazyRendering();
83695
+ if (this.isCurrentStateElement(this.getStateElement())) {
83696
+ this.row.setRootElement(undefined);
83697
+ this.stopLazyRendering();
83698
+ }
83641
83699
  };
83642
83700
  SurveyRow.prototype.createElement = function (element, elementIndex) {
83643
83701
  var index = elementIndex ? "-" + elementIndex : 0;
@@ -85250,10 +85308,6 @@ var page_SurveyPage = /** @class */ (function (_super) {
85250
85308
  enumerable: false,
85251
85309
  configurable: true
85252
85310
  });
85253
- // shouldComponentUpdate(nextProps: any, nextState: any): boolean {
85254
- // if(!super.shouldComponentUpdate(nextProps, nextState)) return false;
85255
- // return true;
85256
- // }
85257
85311
  SurveyPage.prototype.renderElement = function () {
85258
85312
  var title = this.renderTitle();
85259
85313
  var description = this.renderDescription();