@ -121,16 +121,25 @@ public partial class NumberInput<NumberType>:InputBase where NumberType : INumbe
}
}
if ( string . IsNullOrEmpty ( newVal ) )
if ( string . IsNullOrEmpty ( newVal ) )
{
{
await ValueChanged . InvokeAsync ( ( NumberType ) Convert . ChangeType ( AdjustDecimalPlaces ( ( NumberType ) Convert . ChangeType ( null , typeof ( NumberType ) ) ) , typeof ( NumberType ) ) ) ;
await ValueChanged . InvokeAsync ( ( NumberType ) Convert . ChangeType ( ( NumberType ) Convert . ChangeType ( null , typeof ( NumberType ) ) , typeof ( NumberType ) ) ) ;
}
}
else
else
{
{
if ( ! newVal . Equals ( _value ) )
if ( ! newVal . Equals ( _value ) )
await ValueChanged . InvokeAsync ( ( NumberType ) Convert . ChangeType ( AdjustDecimalPlaces ( ( NumberType ) Convert . ChangeType ( newVal , typeof ( NumberType ) ) ) , typeof ( NumberType ) ) ) ;
await ValueChanged . InvokeAsync ( ( NumberType ) Convert . ChangeType ( ( NumberType ) Convert . ChangeType ( newVal , typeof ( NumberType ) ) , typeof ( NumberType ) ) ) ;
}
}
}
}
}
}
public async Task Change ( ChangeEventArgs args )
{
if ( args . Value is not null )
{
Value = AdjustDecimalPlaces ( ( NumberType ) Convert . ChangeType ( args . Value , typeof ( NumberType ) ) ) ;
}
ValueChanged . InvokeAsync ( Value ) ;
}
[Parameter] public EventCallback < KeyboardEventArgs > OnKeyDown { get ; set ; }
[Parameter] public EventCallback < KeyboardEventArgs > OnKeyDown { get ; set ; }
private bool CheckKey ( string key )
private bool CheckKey ( string key )