MudBlazor/MudBlazor

MudAutocomplete submits form when item is selected with Enter-key

Ouverte

#6 657 ouverte le 14 avr. 2023

 (4 commentaires) (8 réactions) (0 personne assignée)C# (1 631 forks)batch import
buggood first issuehas workaround

Métriques du dépôt

Stars
 (10 394 étoiles)
Métriques de merge PR
 (Merge moyen 6j 6h) (108 PRs mergées en 30 j)

Description

Bug type

Component

Component name

MudAutocomplete

What happened?

I have a MudAutocomplete inside an blazor EditForm. When selecting an item with the Enter-key in the MudBlazor MudAutocomplete component, the form is also submitted inmediatly. How can I prevent this from happening.

Expected behavior

I expect the item to be selected, but then the Enter-key event to be prevented to bubble up.

Reproduction link

https://try.mudblazor.com/snippet/mamnaxnYHpAaZKwY

Reproduction steps

1.Select an item in the Autocomplete field with the Enter-Key 2.See that the Form is submitted --> Action submitted label 3.I also placed a MudSelect component in the form. The MudSelect does not have this problem in the same scenario ...

Relevant log output

No response

Version (bug)

6.1.9

Version (working)

No response

What browsers are you seeing the problem on?

Chrome

On what operating system are you experiencing the issue?

Windows, Linux

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Guide contributeur