-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Server-side Blazor 0.5.1 doesn't update active class on NavLink element #15751
Comments
@Andrzej-W I think you are seeing the same issue that I referenced in aspnet/Blazor#1211; I was OK with adding the JS required by Bootstrap to my project but apparently some of the Bootstrap components will interfere with Blazor. The suggest route was to consider BlazorStrap. I am trying to port BlazorStrap from 0.3.0 to 0.5.1 and am having a couple of issues. When I resolve them I'll put out a PR for BlazorStrap. |
@MarkStega it is not related to aspnet/Blazor#1211 at all. This is standard project created by VS. It doesn't require any JavaScript. Problem is visible when I try to return 500 forecasts. When I return 5 or 50 forecasts it works correctly. Probably there is subtle bug somewhere in async code on the server or on the client. |
Seeing this as well... It's not limited to just the navlink. Other simple bindings can fail to update as well, and it's fairly easy to reproduce. Seems to be some kind of timing issue or race condition. The problem goes away if you add any kind of delay to the back end:
Removing the delay causes the problem to re-appear. |
This problem still exists in 0.6.0 |
Any Error message in the console? |
@vertonghenb I don't see any errors in web browser console. |
@Andrzej-W, did you try to place the NavLink for FetchData between the NavLink for Home and that of the Counter, and see if the issue remains ? |
I have just published "default" server side application to Azure. I have made only one change in WeatherForecastService.cs
As you can see service now returns 500 instead of 5 forecasts.
We can click on
Home
andCounter
menu links and everything works as expected. Try to click onFetch data
. At first everything works, butactive
class onNavLink
(strictly speaking on<a>
element) is not removed fromHome
orCounter
and not added toFetch data
.http://blazorserwer.azurewebsites.net/
The text was updated successfully, but these errors were encountered: