Some not rounded values can trigger ValueChange event
Hi,
I have two SfNumericTextBox that can update each other and perform api call to make some calculation.
The API can return a not rounded value. When we set a not rounded value to the variable, the SfNumericTextBox triggers the ValueChanged event, which is not wanted.
Please see the repro,when you set 5 to the Value A input, the event is triggered by the Value B input, otherwise it's not : https://blazorplayground.syncfusion.com/rDheDkrESvCYciMl
Regards.
We have considered the reported issue "NumericTextBox ValueChanged Not Triggering on Decimal Precision Update Between Linked Control " as a bug from our end and the fix for the issue will be included in our upcoming weekly patch release, which is expected to be rolled out on mid of the November, 2025 .
Now you can track the status of the reported issue through the feedback below,
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
ValueChanged event in Blazor is designed to respond only to user interactions such as typing in the textbox or clicking increment/decrement buttons.When the
Value property is updated programmatically (e.g., numericTextBox.Value = 10;), it directly modifies the component’s internal state without simulating a user action. As a result, the ValueChanged event is not triggered.This behavior is intentional to prevent unnecessary event invocations, which could lead to:
- Infinite loops (e.g., if the event handler also updates the value)
- Performance degradation
To ensure the NumericTextBox
ValueChange event is triggered for both user interactions and programmatic updates, consider using a custom event or explicitly invoking logic that handles both cases. Alternatively, use a wrapper or binding mechanism that detects and responds to all value changes.Query 2: ValueChanged Event Triggered Due to Floating Point Precision
When updating the value programmatically with a floating-point number (e.g.,
numericTextBox.Value = 39.40000000000003), the ValueChanged event is triggered because the rendered value (rounded to 2 decimals) differs from the internal value.Blazor compares the previous and current values, and due to the precision mismatch, it detects a change and fires the event.
To prevent unintended
ValueChanged triggers, round the value before assigning it:- 2 Replies
- 2 Participants
- Marked answer
-
JB Julien Barach
- Sep 29, 2025 04:18 PM UTC
- Nov 20, 2025 05:08 PM UTC