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

Pressing Enter/Return key submits form when there is a single MultiSelect and it has focus #2241

Closed
wkrick opened this issue Mar 1, 2022 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@wkrick
Copy link

wkrick commented Mar 1, 2022

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primevue/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=110

Current behavior
If you have a MultiSelect alone in a form tag and the MultiSelect has focus, pressing "ENTER" will submit the form.

However, if you add a second control AFTER the MultiSelect like a Dropdown, then it will no longer submit when focused and "ENTER" is pressed.

Adding v-on:submit.prevent="" to the form tag doesn't appear to make any difference in the behavior.

Expected behavior
I would expect it to NOT submit in either case.

Minimal reproduction of the problem with instructions

https://codesandbox.io/s/twilight-glitter-3m4p8j?file=/src/App.vue

INSTRUCTIONS:

  1. Click in the browser window and press the "TAB" key until the first MultiSelect has focus
  2. press the "ENTER" key
  3. notice that the page submits
  4. repeat the test, except give the second MultiSelect focus this time
  5. notice that pressing "ENTER" does NOT submit

What is the motivation / use case for changing the behavior?
I'm trying to get consistent behavior across my app. I don't actually want the form to submit at all.

Please tell us about your environment:
Windows 10, VS Code, npm, Vite

  • Vue version: 3.2.25

  • PrimeVue version: 3.12.0

  • Browser:
    Firefox 97.0.1 (64-bit), Chrome 98.0.4758.102 (Official Build) (64-bit)

@tugcekucukoglu tugcekucukoglu added Status: Pending Review Issue or pull request is being reviewed by Core Team Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Pending Review Issue or pull request is being reviewed by Core Team labels Mar 2, 2022
@tugcekucukoglu tugcekucukoglu added this to the 3.13.0 milestone Mar 4, 2022
@tugcekucukoglu tugcekucukoglu self-assigned this Mar 4, 2022
tugcekucukoglu added a commit to tugcekucukoglu/primevue that referenced this issue Mar 4, 2022
…here is a single MultiSelect and it has focus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants