Radzen Numeric doesn't bind value to model when form is submitted by key-enter pressed

Within a RadzenTemplateForm I have a RadzenNumeric component bind to an integer model property (@bind-Value="model.int_property") and the whole form is posted via Submit button.

When we post the form via the button, no problems at all with the bind "numeric field-model property", but when we post the form by pressing "key-enter" after manually changing the value of the numeric field, the new (integer) value is not bind to the model and than the model is saved with the "old" numeric value.

For now we fixed it by denying the post by pressing key-enter, but how can this be fixed in a better way?

Thanks in advance

Hi @Alessandro_Zelli,

Welcome to the Radzen community!

Unfortunately I am not sure how to reproduce this issue. You can check the tips for info how to provide additional info.

Hi @korchev
thank you!

attached you can find a screenshot of the form I'm working on.

Point 1 is the Radzen Numeric field (Favorite) bind to a model property (value 968).
Point 2 is the (submit) button.
The whole form is a RadzenTemplateForm.

When in point 2 button is clicked to post, new value of point 1 is saved correct.

When I manually edit point 1 (therefore change from 968 to a different number) and press enter from the keyboard, the form is posted but the new value of the numeric field is not saved and turns back to its original value (968).

Is there a way to avoid this behavior when key-enter is pressed to post the form?


What happens when you use <input type="number"> instead of the RadzenNumeric?

Hey @Alessandro_Zelli,

We were able to reproduce the problem and we will do our best to include fix in the next update (early next week).

By not using the RadzenNumeric and <input type='number' @bind-value="..."> instead, the bind works on key-press enter.
For now I'm replacing the RadzenNumeric and keep an eye on a future fix.
Many thanks

Great! looking forward to use the RadzenNumeric component again then!
Many thanks