surveyjs / survey-library

Free JavaScript form builder library with integration for React, Angular, Vue, jQuery, and Knockout.
https://surveyjs.io/form-library
MIT License
4.2k stars 812 forks source link

Error when setting theme colors for "defaultV2" theme #4258

Open timblake78 opened 2 years ago

timblake78 commented 2 years ago

<

Are you requesting a feature, reporting a bug or asking a question?

Bug

What is the current behavior?

Attempting to set the theme colors for "defaultV2" theme results in:

Uncaught TypeError: Cannot set properties of undefined (setting '$main-color') at assessments2?assessmentid=13&assessmentonly=yes&showassessment=yes:33:43

What is the expected behavior?

Successful setting of theme colors.

How would you reproduce the current behavior (if this is a bug)?

Using code below, attempt to set colors for defaultV2 theme.

Provide the test code and the tested page URL (if applicable)

Tested page URL:

Test code

        var defaultThemeColors = Survey.StylesManager.ThemeColors["defaultv2"];

        defaultThemeColors["$main-color"] = "#4084CA";
        defaultThemeColors["$main-hover-color"] = "#4084CA";
        defaultThemeColors["$header-color"] = "#000000";
        defaultThemeColors["$header-background-color"] = "#ececec";

        Survey.StylesManager.applyTheme("defaultV2");

Specify your

ST-1580 commented 2 years ago

Hello,

You can see this example on our site. It works for SurveyJS Library too. You can't customize styles by StylesManager for defaultV2 theme

Thank you, Yaroslav SurveyJS Team