You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
· 1 comment
In .NET8 and .NET9, in a new Blazor WebAssembly app, when using a <select> 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.
<input> works @onchange event, but <select> 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.
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
The text was updated successfully, but these errors were encountered:
The original poster says that it fires as expected in Net6 but not Net8 or Net9. Need to verify if the binding referenced in the @onchange isn't being called from mouse clicks in the same way as keyboard changes at runtime.
Is there an existing issue for this?
Describe the bug
In .NET8 and .NET9, in a new Blazor WebAssembly app, when using a
<select>
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.
<input>
works@onchange
event, but<select>
noIn 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.
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
eventSteps 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 methodPut a breakpoint in the method assigned to the
@onchange
eventRun 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
The text was updated successfully, but these errors were encountered: