ValueChanged { get; set; }
- public async Task ChangeValueAsync(ChangeEventArgs args)
+ public async Task ChangeValueAsync(ChangeEventArgs args)
{
if (args.Value is not null)
{
NumberType value = (NumberType)Convert.ChangeType(args.Value, typeof(NumberType));
- if (value.ToString().Length > 0)
+ if (value.ToString().Length <= 0)
{
- value = AdjustDecimalPlaces(value);
- //await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(value, typeof(NumberType)));
- }
- else
- {
value = (NumberType)Convert.ChangeType(0, typeof(NumberType));
- //await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(0, typeof(NumberType)));
- }
- Value = value;
- await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(Value, typeof(NumberType)));
- }
- }
-
- private double CalculateStep(double step)
- {
- double CalculatedStep = 1;
- if (DecimalPlaces > 0)
- {
- var CurrentStepDecmalPlaces = Helper.GetDecimalPlaces(step);
-
- if (CurrentStepDecmalPlaces > DecimalPlaces)
- {
- for (int i = 0; i < DecimalPlaces; i++)
- {
- CalculatedStep = CalculatedStep / 10;
- }
}
+ await ValueChanged.InvokeAsync((NumberType)Convert.ChangeType(AdjustDecimalPlaces(value), typeof(NumberType)));
}
- return CalculatedStep;
}
private NumberType AdjustDecimalPlaces(NumberType value)
diff --git a/src/Connected.Components/Components/InputText.razor b/src/Connected.Components/Components/InputText.razor
index 360bfe5..3a848fc 100644
--- a/src/Connected.Components/Components/InputText.razor
+++ b/src/Connected.Components/Components/InputText.razor
@@ -5,25 +5,14 @@
@if (NumOfRows==1)
{
- @if (!IsPassword)
- {
-
- } else
- {
-
- }
+
} else
{