Closed StephenOTT closed 4 months ago
I also implemented the loading theme: https://www.fluentui-blazor.net/DesignTheme#how-to-remove-the-%22bright-flash%22-on-loading
But that does not work. When loading runs it uses the default theme/loading.
Going by the picture you showed above this quoted text, how do you know it is not working? The values from the picture indicate the 'default' theme settings are used/set
@vnbaaij If i set the theme to dark and local storage shows:
and then i reload the page:
The light version is still showing. Compared with the Docs site, where you change theme and colour and it is represented in the loading window.
@vnbaaij If i set the theme to dark and local storage shows:
and then i reload the page:
The light version is still showing. Compared with the Docs site, where you change theme and colour and it is represented in the loading window.
Did you added the loading theme component on top of body tag in index.html?
@AathifMahir Yes, per https://github.com/microsoft/fluentui-blazor/issues/1182
fluent-theme
is only for the pre-load. The theme is probably applied with a FluentDesignTheme
in another page. Could you check how many FluentDesignTheme
do you have in your code?
@dvoituron the FluentDesignTheme
is placed in two pages:
Both code snippets are shown in: https://github.com/microsoft/fluentui-blazor/issues/1182#issue-2052411576
I downloaded your code, from your example repo (and the theme
branch).
The result seems correct when using InteractiveServer
mode, but a JS error is displayed when using InteractiveAuto
mode.
We could check why this error occurs in this mode, but in the meantime you could change the RenderMode for this component.
https://github.com/microsoft/fluentui-blazor/assets/8350694/f2d44565-039b-4bad-8b0b-d977d842db67
Yes, that InteractiveAuto issue is the same one I had, seems to still be there.
I'm using static web assembly build with .NET 8 and a couple of instances of the <FluentDesignTheme>
component and also have the same error in the console log. Should I only use one instance for the app? Im using a second one for the settings page.
Uncaught (in promise) Error: Assertion failed - heap is currently locked
at Ot (blazor.webassembly.js:1:46748)
at Object.beginInvokeDotNetFromJS (blazor.webassembly.js:1:44671)
at g.invokeDotNetMethodAsync (blazor.webassembly.js:1:3956)
at S.invokeMethodAsync (blazor.webassembly.js:1:5464)
at As.<anonymous> (FluentDesignTheme.razor.js:7:30)
at As.dispatchAttributeChanged (DesignTheme.ts:272:12)
at As.attributeChangedCallback (DesignTheme.ts:223:14)
at le.setOrRemoveAttributeOrProperty (blazor.webassembly.js:1:28025)
at le.applyAttribute (blazor.webassembly.js:1:26970)
at le.applyEdits (blazor.webassembly.js:1:23940)
Is there any ETA for this fix, I'm kind a blocked on Releasing a Build to Production due to this issue? @vnbaaij
is everyone having lack of light vs dark on the loading page? Is it confirmed that the loading page always using the light theme part of this issue?
@StephenOTT See this documentation page.
To avoid a "flash" effect when the page loads (mainly in dark mode), as described below, we recommend you add these lines of code to the index.html or App.razor file (or _layout.cshtml file if you upgraded you project from an earlier .NET version).
<!-- Set the default theme --> <script src="_content/Microsoft.FluentUI.AspNetCore.Components/js/loading-theme.js" type="text/javascript"></script> <loading-theme storage-name="theme"></loading-theme
This problem will be corrected with this PR: #1419
This problem will be corrected with this PR: #1419
Anything on this issue https://github.com/microsoft/fluentui-blazor/issues/1148
This issue is happening when the theme is set to system
Continuation from: https://github.com/microsoft/fluentui-blazor/issues/1160#issuecomment-1865135542_
I have a panel similar to the demo site panel for switching themes:
App.razor:
and index.html:
When i change themes I get the error above.
Using 4.2.1. Cleared browser/app cache. Using Blazor WASM in chrome
The theme changes and is kept in storage.
I also implemented the loading theme: https://www.fluentui-blazor.net/DesignTheme#how-to-remove-the-%22bright-flash%22-on-loading
But that does not work. When loading runs it uses the default theme/loading. There are no errors.