ValueChanged event is not working as expected
Hi there,
Working with TextBox component and ValueChanged event I noticed ValueChanged event is not being fired when I start typing into the TextBox component. I know the difference between ValueChanged and ValueChange is that ValueChange is triggered when you focusout the textBox but ValueChanged when the value of the TextBox changes.
Is this a bug? Also I saw there is OnInput event is there any difference with ValueChanged?
SIGN IN To post a reply.
3 Replies
PM
Ponmani Murugaiyan
Syncfusion Team
June 30, 2021 10:32 AM UTC
Hi Adriana,
Thanks for contacting Syncfusion support.
Query: I noticed ValueChanged event is not being fired when I start typing into the TextBox component.
The ValueChanged event will not be fired when start typing. Because, we would like to know you that both the ValueChange and ValueChanged event triggers when focus out the component and the difference between them is the ValuChanged event contains the only argument with changed value and ValueChange event is triggered with arguments of previous value and current value and whether the value has changed programmatically or user interacted.
So, as per your requirement to get the event when start typing is Input event, which fired each time when the value of TextBox has changed.
|
Events |
Description |
Arguments |
|
Input |
Triggers each time when the value of TextBox has changed.
|
|
|
ValueChanged |
Specifies the callback to trigger when the value changes.
|
|
|
valueChange |
Triggers when the content of TextBox has changed and gets focus-out.
|
|
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/TextBox_Events-1213354305
Regards,
Ponmani M
LP
Lukasz Pazdziorek
February 20, 2022 12:17 AM UTC
Hello,
However if you use SfMaskedTextBox then the ValueChanged event is being fired after typing every character and I have based my application logic on it. Can you explain what is the correct behavior?
SP
Sureshkumar P
Syncfusion Team
February 21, 2022 11:24 AM UTC
Hi Lukasz,
In our maskedtextbox component we need to validate given character is matching or not in mask property, so the change event triggered after every key inserted. Which is the reason the ValueChanged event is being fired after typing every character. But previously updated response is related to textbox component. This is the correct behavior of masked textbox component.
Regards,
Sureshkumar P
SIGN IN To post a reply.
- 3 Replies
- 4 Participants
-
AS Adriana Selena Tito Ilasaca
- Jun 30, 2021 01:03 AM UTC
- Feb 21, 2022 11:24 AM UTC