diff --git a/packages/survey-vue3-ui/src/base.ts b/packages/survey-vue3-ui/src/base.ts index 5145c39c63..0cac24c3ce 100644 --- a/packages/survey-vue3-ui/src/base.ts +++ b/packages/survey-vue3-ui/src/base.ts @@ -118,17 +118,18 @@ export function useBase( immediate: true, } ); + let isOnBeforeUnmountCalled = false; onBeforeUnmount(() => { - const model = getModel(); - if (model) { - unMakeReactive(model); - stopWatch(); + if (!isOnBeforeUnmountCalled) { + const model = getModel(); + if (model) { + unMakeReactive(model); + stopWatch(); + if (clean) clean(model); + } + isOnBeforeUnmountCalled = true; } }); - onUnmounted(() => { - const model = getModel(); - if (model && clean) clean(model); - }); } export function useQuestion(