title: Custom component doesn't return value when the validation is not successful
body: <p>I'm creating a simple custom currency component in Blazor. I inherit from <code>InputBase&lt;string&gt;</code> and implement <code>bool TryParseValueFromString(string value, out TValue result, out string validationErrorMessage)</code></p>
  <p>The problem is that i want to return value when the <code>TryParseValueFromString</code> is not successful.</p>
  <p>Parent component</p>
  <pre><code> &lt;div class=&quot;form-group mb-3&quot;&gt;
              &lt;label for=&quot;MyInputTextArea&quot;&gt;Input currency&lt;/label&gt;
              &lt;InputCurrency @bind-Value=FormData.SomeStringCurrency id=&quot;MyInputTextArea&quot; class=&quot;form-control&quot;/&gt;
              &lt;ValidationMessage For=&quot;() =&gt; FormData.SomeStringCurrency&quot;&gt;&lt;/ValidationMessage&gt;
          &lt;/div&gt;
  </code></pre>
  <p>Custom component</p>
  <pre><code>@using System.Globalization
  @inherits InputBase&lt;string&gt;
  
  &lt;input type=&quot;string&quot; @attributes=AdditionalAttributes class=@CssClass @bind=CurrentValueAsString /&gt;
  
  @code{
  private CultureInfo _culture = CultureInfo.CreateSpecificCulture(&quot;de&quot;);
  
  protected override string FormatValueAsString(string value)
  {
      if (string.IsNullOrWhiteSpace(value))
      {
          return string.Empty;
      }
  
      if (Decimal.TryParse(value, NumberStyles.Currency, _culture, out decimal result))
      {
          return Convert.ToDecimal(value).ToString(&quot;N&quot;, _culture);
      }
      else
      {
          return value;
      }
  }
  
  protected override bool TryParseValueFromString(string value, out string result, out string validationErrorMessage)
  {
      try
      {
          var decimalValue = ReturnDecimalIfSuccessFul(value);
  
          result = decimalValue.ToString();
          validationErrorMessage = null;
          return true;
      }
      catch
      {
          validationErrorMessage = &quot;Not a valid currency value.&quot;;
          result = value; // here i am assigning the value but it's not returned 
          return false;
      }
  }
  
  private decimal? ReturnDecimalIfSuccessFul(string value)
  {
      if (string.IsNullOrWhiteSpace(value))
      {
          return null;
      }
  
      var result = Decimal.Parse(value, NumberStyles.Currency, _culture);
      
      return result;
  }
  </code></pre>
  <p><a href="https://i.stack.imgur.com/RQL1Y.png" rel="nofollow noreferrer">user input</a></p>
  <p><a href="https://i.stack.imgur.com/GkjIp.png" rel="nofollow noreferrer">result</a></p>
  <p><a href="https://i.stack.imgur.com/TjrM0.png" rel="nofollow noreferrer">what i expect</a></p>
  <p>When the value is not successfully parsed then is not showed to the user. Only the last successfully value is showed, but I expect to always have the value user put in input...</p>