-
Notifications
You must be signed in to change notification settings - Fork 231
Closed as duplicate of#60018
Closed as duplicate of#60018
Copy link
Labels
Description
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
The bind:after is not firing when used in a select in Blazor WASM (Standalone) targeting .NET 9. I understand this was an issue in .NET 7 and was later fixed. I wonder if this is a regression. You can either use the following code or download from public repo at https://github.com/imsam67/blazor-bind-after-issue
Please also note that I tried it .NET 8 and .NET 7. It seems to work only in .NET 7! When I targeted .NET 8, again, I was NOT able to hit the DoSomething() method which should've fired after selecting an option.
<div>
<select @bind="SelectedState" @bind:after="DoSomething">
<option value="">Please select one</option>
<option value="AK">Alaska</option>
<option value="MT">Montana</option>
<option value="WY">Wyoming</option>
</select>
</div>
@code {
private string SelectedState;
private async Task DoSomething()
{
var userSelected = SelectedState; // Have a break point here but the code doesn't hit it
}
}
Expected Behavior
When an option is selected, the DoSomething() method should be called.
Steps To Reproduce
Create a Blazor WASM (Standalone) project targeting .NET 9 and use the above code in any page.
Exceptions (if any)
None
.NET Version
9.0.201
Anything else?
No