fluentui-blazor: FluentTextField does not update model before form submit when using enter to submit

🐛 Bug Report

When using the enter key to submit a form, a currently focused FluentTextField does not properly update the model before the form is submit. A standard InputText does this.

💻 Repro or Code Sample

<FluentTextField @bind-Value:get="@model.SomeString" @bind-Value:set="@model.SetSomeString"></FluentTextField>

Focus the text field, change value, hit enter, and observe the form is submit with the old model value.

<InputText @bind-Value:get="@model.SomeString" @bind-Value:set="@model.SetSomeString"></InputText>

Focus the text field, change value, hit enter, and observe the form is submit with the properly updated model value.

🤔 Expected Behavior

The FluentTextField should update its binding properly, in the same way as the standard InputText.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 18 (1 by maintainers)

Most upvoted comments

Workaround provided. Original issue was solved in a different way.

To me it was important to somehow prevent submitting outdated data. Luckily that problem went away when I had to add some async validation and removed the explicit submit type from the respective button for that. That way the form is not automatically submitted on enter anymore.

Ok, thanks. Might take a few days before I take a look (🎄 break)