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.


2 Replies 1 reply marked as answer

MR Mallesh Ravi Chandran Syncfusion Team October 17, 2025 02:47 PM UTC

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,

https://www.syncfusion.com/feedback/70728/numerictextbox-valuechanged-not-triggering-on-decimal-precision-update-between

  

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.”



MR Mallesh Ravi Chandran Syncfusion Team November 20, 2025 05:08 PM UTC

Query 1: ValueChanged Event Not Triggered on Programmatic Updates
Root Cause:
The 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
Solution:
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
Root Cause:
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.
Solution:
To prevent unintended
ValueChanged triggers, round the value before assigning it:
Math.Round(39.40000000000003, 2); 

Marked as answer
Loader.
Up arrow icon