Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Can i make Blazor Server stop overwriting client-side data-bs-theme customization?

$
0
0

I want the user to be able to set the theme (client-side). This should be stored on the client side as well in local storage.

Then when the website loads, a client-side javascript applies the theme via the data-bs-theme attribute on the <html> element.

The issue is, every time Blazor server re-renders a component, for some reason it also re-renders the <html> tag, and so it removes my data-bs-theme attribute

How can i make it stay, while keeping the theme customization completely client-sided?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>