Skip to content
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 WebAssembly - HTML select tag with @onchange event does not hit breakpoint when clicking to select values from dropdown using the cursor, but works with up/down key from keyboard #11366

Open
1 task done
Marques01 opened this issue Jan 6, 2025 · 0 comments

Comments

@Marques01
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

In .NET8 and .NET9, in a new Blazor WebAssembly app, when using a tag, with the @onchange event, if I put a breakpoint in the method being triggered (i.e. @onchange="Test"), the breakpoint will not be hit if I click on different values in the dropdown using the mouse. However, the breakpoint is being hit fine when using the up/down keys from the keyboard. works @onchange event, but no In addition, when using the mouse, I can see that the method is run and states are changed - the issue I experienced is the breakpoint that is not being hit. Additional info: doing the same in .NET6 works fine, and breakpoint is being hit just fine in all cases. @page "/" Countries <select class="form-select" @onchange="OnCountryChanged"> USA> Canada Mexico
@code {

private void OnCountryChanged(ChangeEventArgs e)
{
}

}

reference: dotnet/aspnetcore#58615

Expected Behavior

Breakpoint is being hit when using the mouse/cursor to select different values from a select statement with the @onchange event

Steps To Reproduce

Create a new Blazor Web Assembly (WASM) project in VS2022.
Add a select tag to any page (I did it to the Counter component)
add the @onchange event to the select tag, and assign it with a method
Put a breakpoint in the method assigned to the @onchange event
Run the app, click on different values in the dropdown, and see that the breakpoint is not being hit.
Then, try selecting using different values using the up/down keys from the keyboard, and the breakpoint should be hit

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

@javiercn javiercn marked this as a duplicate of dotnet/aspnetcore#59738 Jan 7, 2025
@javiercn javiercn transferred this issue from dotnet/aspnetcore Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant