-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blazor EventCallbacks are not invoked with apps using .NET 8 template #2355
Comments
@epetersoni could you attach a zip of the the .NET 8 you used to reproduce this? I added this issue as acceptance criteria under #1667 so we'll plan to tackle it as part of that (presumably before .NET 6 goes out of support). |
@epetersoni It looks like this is due to the changes to the Blazor startup process and JS initializers for .NET 8. NimbleBlazor relies on the <script src="_framework/blazor.web.js" autostart="false"></script>
<script src="_content/NimbleBlazor/nimble-components/all-components-bundle.min.js"></script>
<script>
Blazor.start({ enableClassicInitializers: true });
</script> However, that Microsoft page states "However, legacy initializer execution is unpredictable." Once we update Nimble Blazor to target .NET 8, we'll update our JS initialization code to use the new methods, so it's probably best to wait for that. (HLD for that work) |
🐛 Bug Report
Our app was initially created with the Blazor Server App .NET 7 template in VisualStudio. We recently followed the guide to update it to the .NET 8 Blazor Web App template.
It looks like at least some Nimble
EventCallback
s are now not getting invoked. Two examples are theNimbleBanner
OpenChanged
, and theNimbleMenuButton
Toggle
.💻 Repro or Code Sample
NimbleBlazor
package (18.0.0
is currently the latest) and required Nimble script / fonts.NimbleBanner
component with anOpenChanged
callback on a page, and withOpen="true"
.🤔 Expected Behavior
The
EventCallback
should get invoked.😯 Current Behavior
The
EventCallback
is not invoked.💁 Possible Solution
Official Nimble .NET 8 support. I'm not sure exactly what difference is causing the behavior change.
🔦 Context
Since updating our app to use the .NET 8 template, a few pieces of functionality that were relying on callbacks are now not working.
We didn't have a specific reason for updating to the .NET 8 template, so we'll need to evaluate what all the callback-related bugs are and whether we should revert the update and / or wait for fixes to this bug.
🌍 Your Environment
The text was updated successfully, but these errors were encountered: