From ded829149baddc766ef123d724bd6e9fcfa1a4df Mon Sep 17 00:00:00 2001 From: OlgaLarina Date: Thu, 21 May 2026 17:38:42 +0300 Subject: [PATCH] Clone input theme --- packages/survey-core/src/survey.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/survey-core/src/survey.ts b/packages/survey-core/src/survey.ts index 13fb023a59..23e69ec0b8 100644 --- a/packages/survey-core/src/survey.ts +++ b/packages/survey-core/src/survey.ts @@ -8386,6 +8386,15 @@ export class SurveyModel extends SurveyElementCore public applyTheme(theme: ITheme): void { if (!theme) return; + const themeClone = {} as ITheme; + Object.keys(theme).forEach((key: string) => { + const themeKey = key as keyof ITheme; + const value = theme[themeKey]; + (themeClone as any)[themeKey] = typeof value === "object" && value !== null ? { ...value } : value; + }); + this._applyTheme(themeClone); + } + private _applyTheme(theme: ITheme): void { patchLegacyCSSVariables(theme.cssVariables); this.addAnimationResetCSSVariables(theme.cssVariables); Object.keys(theme).forEach((key: keyof ITheme) => {