radzenhq / radzen-blazor

Radzen Blazor is a set of 90+ free native Blazor UI components packed with DataGrid, Scheduler, Charts and robust theming including Material design and FluentUI.
https://www.radzen.com
MIT License
3.53k stars 785 forks source link

Click on any element in the form triggers click on RadzenButton below #1384

Closed nine-2-five closed 8 months ago

nine-2-five commented 8 months ago

Describe the bug NET 8 Maui Blazor, with RadzenTemplateForm or EditForm, with textbox with no click handler and a button with click handler. When any of the elements on the form are tapped, the click event on RadzenButton fires, and fires indefinetly.

To Reproduce Steps to reproduce the behavior:

  1. Create a form with RadzenTextBox and RadzenButton
  2. Click on a textbox
  3. Click handler for RadzenButton fires (and it won't stop firing)

Alternatively link your repo with a sample project that can be run.

Expected behavior The click handler should only fire when the RadzenButton is clicked.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

enchev commented 8 months ago

By definition HTML form will be submitted on ENTER: https://www.w3.org/TR/2018/SPSD-html5-20180327/forms.html#implicit-submission You can set the button type to Button instead Submit to avoid this.