diff --git a/src/Masa.Blazor/Components/TextField/MTextField.cs b/src/Masa.Blazor/Components/TextField/MTextField.cs index 20879fe716..fb07e894d1 100644 --- a/src/Masa.Blazor/Components/TextField/MTextField.cs +++ b/src/Masa.Blazor/Components/TextField/MTextField.cs @@ -708,7 +708,7 @@ private async Task OnValueChangedAsync(ChangeEventArgs args, EventCallback(string? value, out T result) + private static bool TryConvertTo(string? value, out T? result) { var succeeded = BindConverter.TryConvertTo(value, CultureInfo.InvariantCulture, out var val); @@ -718,11 +718,11 @@ private static bool TryConvertTo(string? value, out T result) return true; } - result = default!; + result = default; return false; } - private void UpdateValue(string? originValue, bool succeeded, TValue convertedValue) + private void UpdateValue(string? originValue, bool succeeded, TValue? convertedValue) { if (succeeded) {