onchange only fired when a breakpoint is set in code-behind #61603
Labels
area-blazor
Includes: Blazor, Razor Components
Author: Migration Bot 🤖
The issue was created by a issue mover bot. The author may not be the actual author.
Needs: Author Feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
Needs: Repro
Indicates that the team needs a repro project to continue the investigation on this issue
Status: No Recent Activity
This issue has been moved from a ticket on Developer Community.
[severity:I'm unable to use this version]
The following code is a piece of razor that is build up using reflection. In this part the 'property' is a Dictionary and it constructs a dropdown to select an enum (key) and a text-box (value). A + button to add (or update) the kv-pair in the dictionary and below that display a table with kv-pairs. It is a tool to support dev's in faster testing and dev of a specific proprietary system. Lay-out is not important.
The 'OnUpdate' is never triggered. To confirm this I added a Dummy() method and call it from the OnChange-trigger.
´´´
private void Dummy(object e)
{
Debug.WriteLine($"Current e is : {e}");
}
´´´
When you add some text, hit the button, you expect the onchange to get fired. If I set a breakpoint in the dummy method it stops at the breakpoint, the variable is updated (in the lambda function in razor) and then the AddDictionaryItem is triggered. As one would expect.
If I remove the breakpoint. The OnUpdate does not get triggered, proof Dummy is not called, the onclick (AddDictionaryItem) is called, but fails because the onupdate was not triggered before.
Setting the breakpoint in dummy again does not stop there anymore, unless I reload the page.
Bug ? Or error in my implementation ? Did not found a workaround yet. Any suggestions ?
Original Comments
Feedback Bot on 3/28/2025, 04:36 AM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
The text was updated successfully, but these errors were encountered: