From db3305c7866b67cacb6defac3c661835e4d445ed Mon Sep 17 00:00:00 2001 From: Andrew Telnov Date: Mon, 30 Aug 2021 22:23:35 +0300 Subject: [PATCH] Fix: question.isAnswered and question.cssTitle do not update correctly #3237 --- .../default-title/default-title.vue | 4 +- src/vue/element.vue | 11 ++-- src/vue/elementheader.vue | 19 ++----- testCafe/survey/questionsIsAnswered.js | 50 ++++++++++++++++++ tests/surveyquestiontests.ts | 51 ++++++++++++++++++- 5 files changed, 115 insertions(+), 20 deletions(-) create mode 100644 testCafe/survey/questionsIsAnswered.js diff --git a/src/vue/components/default-title/default-title.vue b/src/vue/components/default-title/default-title.vue index a1d348f053..7d381f70fc 100644 --- a/src/vue/components/default-title/default-title.vue +++ b/src/vue/components/default-title/default-title.vue @@ -41,11 +41,13 @@ export class DefaultTitle extends Vue { mounted() { this.isCollapsed = this.element.isCollapsed; - this.element.stateChangedCallback = () => { this.isCollapsed = this.element.isCollapsed; }; } + beforeDestroy() { + this.element.stateChangedCallback = null; + } } Vue.component("sv-default-title", DefaultTitle); diff --git a/src/vue/element.vue b/src/vue/element.vue index eb3712a7a5..1027bd9f0b 100644 --- a/src/vue/element.vue +++ b/src/vue/element.vue @@ -46,12 +46,17 @@