problems when theme imported in blazor webassembly
I bought a theme from envato and imported it in a blazor webassembly pwa app. Initially Some functions are working, some are broken. For that i do javascript interop after that they work smoothly. But yesterday, when I checked it for the mobile version (responsive) some javascript functions were not working.
I am sharing a screenshot in which the toggle button activates when the screen changes to mobile size, then the close button does not close the panel of the menu.
Anyone can you help me in that case?
Replies (2)
This is often caused by JavaScript event handlers or theme scripts not being initialized correctly after Blazor WebAssembly renders or re-renders the responsive menu. Since the toggle works but the close button fails specifically at the mobile breakpoint, I’d first inspect whether the close handler is bound to the correct DOM element and whether Blazor is replacing that element after the JavaScript initialization. Re-initializing the theme’s menu script after relevant renders and checking for duplicate or stale event listeners can usually narrow down the issue. Clear, reliable behavior across desktop and mobile is also important for professional HSEQ websites such as where users need to access safety information easily on any device.
Hi,
Unfortunately, we haven't tried to convert our Metronic Blazor Server theme to Blazor Webassembly yet. We will try it and consider adding a new version in upcoming releases.
You need to initialize our main js components globally.
You can check initialization example in file Starterkit/Shared/MasterInit.razor.