Hi Tristan Kim,
Thank you for reaching out to us.
To address the issue of the ComboBox sometimes changing the entered value to 0, you should update the TItem type from int to int? in the component. This change will prevent the ComboBox from displaying '0' when the value is cleared in the input. Below is the modified code snippet for your reference:
<PageTitle>Home</PageTitle>
<div> <SfTextBox></SfTextBox> <SfComboBox TValue=int? TItem=int? Placeholder="Timeout Value" DataSource="@TimeoutValues" Width="300px" @bind-Value="@TimeoutValue" AllowCustom="true" FloatLabelType="FloatLabelType.Always"> </SfComboBox> <SfTextBox></SfTextBox> </div>
@code { private int? TimeoutValue { get; set; } private int?[] TimeoutValues = new int?[] {10, 15, 20, 25, 30, 45, 60, 90, 120}; }
|
This adjustment should resolve the inconsistent behavior you are experiencing with the ComboBox when entering custom values.
Sample: https://blazorplayground.syncfusion.com/BZBpjkBQJyWHUAoc
Regards,
Priyanka K