Open iotalambda opened 10 months ago
I just tried it with same template and your exact code. Not seeing this behavior:
No, did not do that. Will try that next
Ok, can reproduce with Enter
keypress...weird.
While we search for a solution, a workaround is to remove the Type=ButtonType.Submit
part from the code. The IncrementCount
method will then only be called once.
Of course, removing the submit is not alway going to be a viable solution.
I've traced back the bug all the way to the FAST source code (which is what is used to build the fluent-button
web component that we wrap in our FluentButton
component): https://github.com/microsoft/fast/issues/6704.
Unfortunately, it needs to be fixed there first. After that we need to get a new release of the web components script and integrate that in our library. I'm in contact with the FAST maintainers to see if and how this can be expidited but I'm afraid this behavior can not be changed/circumvented when usen the keyboard until the scripts get fixed.
Thanks @vnbaaij. Too bad the problem lies so deep.
Also, another workaround is to use a non-fluent submit button for the time being.
@vnbaaij do you have a solution in sight?
No, nothing has changed. We anticipate it wont be fixed until we have the new web components
🐛 Bug Report
When navigating to an EditForm's submit button by keyboard and hitting Enter, submit occurs twice.
💻 Repro or Code Sample
dotnet new install Microsoft.FluentUI.AspNetCore.Templates::4.1.1
dotnet new fluentblazor
Replace Counter.razor content with the following, tab your way to the FluentButton and hit Enter -> current count is incremented by 2.
🌍 Your Environment
Occurs at least in Edge and Firefox