Hello,
It would be great if you could raise an event when the clear text button is clicked on the textbox.
So far, I subscribe to the ValueChanged event and check if the string is null or empty, but this is not exactly the same as "ClearButtonClicked".
Thank you in advance.
<SfTextBox ShowClearButton="true" ValueChange="OnValueChange"></SfTextBox>
@code{
public void OnValueChange(ChangedEventArgs args)
{
}
} |
Makes sense.
Thanks a lot ffor your suggestion!
Hello,
What about SfNumericTextbox?
Hi Endre Lovas,
Thank you for getting back to us. We have reviewed your requirement and confirmed that it is possible to achieve this with the NumericTextBox component. By default, there is no specific event triggered when clicking the clear button in the NumericTextBox. However, the ValueChange event will be fired when the clear button is clicked.
Please see the code snippet below for implementation:
<SfNumericTextBox TValue="int?" ShowClearButton="true"> <NumericTextBoxEvents TValue="int?" ValueChange="@ValueChangeHandler"></NumericTextBoxEvents> </SfNumericTextBox>
@code { private void ValueChangeHandler(Syncfusion.Blazor.Inputs.ChangeEventArgs<int?> args) { Console.WriteLine("Event triggered"); } }
|
Sample: https://blazorplayground.syncfusion.com/LZVTZEVRTcGJlWSD
You can refer to the below documentation for further reference,
Documentation: https://blazor.syncfusion.com/documentation/numeric-textbox/events#created
Regards,
Yohapuja S