Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoComplete: Enter does not submit form #5618

Closed
carldenigma opened this issue Apr 19, 2024 · 0 comments
Closed

AutoComplete: Enter does not submit form #5618

carldenigma opened this issue Apr 19, 2024 · 0 comments
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@carldenigma
Copy link
Contributor

Describe the bug

There's an issue with the AutoComplete component that affects native behaviour of input fields and form submission.

When attempting to submit a form using the 'Enter' key, the AutoComplete component captures the action and prevents the default behaviour, even when no overlay panel option is in focus.

To improve accessibility and align the AutoComplete component with native browser behaviour, it should not prevent the default action in this scenario. Instead, hitting 'Enter' on an input field should propagate to submitting the form.

When a overlay option foes have focus then 'Enter' should select the focused option rather than submitting.

Reproducer

https://stackblitz.com/edit/auvw5w?file=src%2FApp.vue

PrimeVue version

3.51.0

Vue version

3.x

Language

ALL

Build / Runtime

Vue CLI App

Browser(s)

No response

Steps to reproduce the behavior

  1. Click in the input field
  2. Type Value
  3. Select Option
  4. Press 'Enter' While input still has focus to submit

Expected behavior

The form should submit and the alert action handler should appear; as it does when you click the button to submit.

@carldenigma carldenigma added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 19, 2024
carldenigma added a commit to carldenigma/primevue that referenced this issue Apr 19, 2024
@tugcekucukoglu tugcekucukoglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 19, 2024
@tugcekucukoglu tugcekucukoglu added this to the 3.52.0 milestone Apr 19, 2024
@tugcekucukoglu tugcekucukoglu self-assigned this Apr 19, 2024
tugcekucukoglu added a commit that referenced this issue Apr 19, 2024
#5618 - Updated AutoComplete to allow form submission using return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants