question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modern Theme cannot be applied after change in c2d18fa49744d3621773f11db8ca9caad211b223

See original GitHub issue

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

A bug (a regression to be precise)

What is the current behavior?

If you run Survey.StylesManager.applyTheme('modern') from the code embedding the survey library, it still uses the default css.

What is the expected behavior?

The css of the modern theme is used.

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

See above.

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

I have tested this on internal pages which cannot be made public, however I hunted down the commit and can give some more context that should help fixing the bug:

The bug has been traced to commit c2d18fa49744d3621773f11db8ca9caad211b223 .

Before this commit, if you embed survey-react the following dom is produced:

<div class="sv-root-modern"><form>
...
   <input class="sv-btn sv-footer__complete-btn" type="button" value="Complete" style="margin-right: 5px;">
...
</form></div>

With this, the calculated css is correctly overriden and the modern theme is applied as one can see in the development console.

After the before mentioned commit the dom is the following:

<div class="sv_main sv_default_css"><form>
...
   <input class="sv-btn sv-footer__complete-btn" type="button" value="Complete" style="margin-right: 5px;">
...
</form></div>

Hence, the theme is not applied as the sv-root-modern class is missing now.

I hope that will help!

Sincerely, Eckhard

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
tsv2013commented, Dec 20, 2021

The theme should be applied before model created:

  Survey.StylesManager.applyTheme("modern");
  const survey = new Survey.Model(json);

Here is your updated example - https://codesandbox.io/s/adoring-tdd-yjeej

0reactions
tsv2013commented, Dec 21, 2021

The behavior regresses at the mentioned commit

In all our samples the theme is applied in the start of code. It wasn’t supposed that you can switch the theme at any point of your program.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SharePoint site not applying theme changes after I change the ...
Hello all, I am trying to change the theme of my website but it is not applying the changes. I am using SharePoint...
Read more >
This theme can't be applied to the ... - The Windows Club
While changing a theme on Windows 11/10, if you see This theme can't be applied to the desktop error message, then this post...
Read more >
This Theme Cannot Be Applied To The Desktop Windows 10 FIX
Your browser can't play this video. Learn more. Switch camera.
Read more >
How to Fix This Theme can't be applied to the ... - YouTube
Fix This Theme can't be applied to the desktop in WindowsWindows10Theme #Can'tApplyTheme # Theme Facebook ...
Read more >
This Theme Can't Be Applied to the Desktop Error ... - YouTube
This Theme Can't Be Applied to the Desktop Error in Windows 10 FIX.Those of you that are fans of customizing your desktop are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found