[TextBox] How can I remove the white space at the beginning and end of the field?

image

private string DS_PALAVRA_CHAVE { get; set }

<RadzenLabel Text="Palavra Chave" Component="InputPalavraChave" />

<RadzenTextBox Name="InputPalavraChave"
               @bind-Value="@DS_PALAVRA_CHAVE"
               class="w-100" />

Hello try this
image
Or
image

There is also a Trim option that does this by default.

<RadzenTextBox Trim="true" ... />

How does it work?

From what I tested, when I enter a value in the field the first time it works normally, however, when I enter it again it stops working.

Gravacao

You can check the implementation.

@zehguilherme like this should work as expected.

<RadzenTextBox Value=@value  ValueChanged=@(args=> value = args.Trim())

@korchev i tested it in the demo and i i agree that work only the first time (with trim prop to true), if u insert only spaces it doesn't trim them.

To replicate:

  1. input a rnd value with spaces around like " test "
  2. Remove focus so Change get invoked and the textbox should be trimmed
  3. U result with "test"
  4. Now add only spaces around "test" like "test "
  5. Remove focus so Change get invoked and the textbox should be trimmed
  6. U result with "test " so trim didnt work as expected

Its like nothing for the cmp is changed so dosnt render the value trimmed (?).
I think its a bug, even if its strage\unusual for an end-user to insert only spaces in a second time edit