Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
I would like to set the Step property based on the value, if the
value is small set the small step and if the value is big set the bigger
step.
For example:
For min = 1 and max = 100, if the
value is equal or greater than 10, set the step to 10, if the value is
10 or smaller set the step to 1. So when increasing the value the values
would be 1,2,3,4,5,6,7,8,9,10,20,30,40,50,60,70,80,90 and 100. When
decreasing the values would be
100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2 and 1.
If I set the Step value based on the current value, there is an issue. For example if the value is 10 and the Step is set to 10 and if the user clicks -, the value is changed to 1. And if the value is 10 and the Step is 1, and the user clicks +, the value is changed to 11.
It can somehow be implemented following way but it is not ideal because the value is flickering.
<SfNumericTextBox Min="1" Max="100" Step="1" @bind-Value="modelEdit.Timeout" >
<NumericTextBoxEvents TValue="int" ValueChange="OnValueChanged" ></NumericTextBoxEvents>
</SfNumericTextBox>
public void OnValueChanged(Syncfusion.Blazor.Inputs.ChangeEventArgs<int> args)
{
if (args.IsInteracted)
{
if (args.Value > args.PreviousValue)
{
if (args.PreviousValue >= 10)
{
modelEdit.Timeout += 9;
}
}
if (args.Value < args.PreviousValue)
{
if (args.PreviousValue > 10)
{
modelEdit.Timeout -= 9;
if (modelEdit.Timeout < 10)
{
modelEdit.Timeout = 10;
}
}
}
}
}
Or is there any other way how to implement it?
Thank you