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

Submitting form on input focus (pressing enter) and dropdown is toggled instead of submitting #41354

Open
3 tasks done
andybeesee opened this issue Apr 7, 2025 · 0 comments
Open
3 tasks done
Labels

Comments

@andybeesee
Copy link

Prerequisites

Describe the issue

Inside of a form tag, if I focus on an input element and press enter to submit, instead of submitting, it will toggle a all of the dropdowns that appear after it with the data-bs-toggle dropdown.

  • Create form
  • add input
  • add dropdown with a button that has data-bs-toggle="dropdown" inside the form
  • focus on input
  • keydown 'enter'
  • see dropdown toggled instead of the form submitting

This doesn't seem like it would be expected behavior

dropdown-toggle-issue.mp4

Reduced test cases

I have a minimal example running: https://codepen.io/andybeesee/pen/jEORdNm

What operating system(s) are you seeing the problem on?

macOS

What browser(s) are you seeing the problem on?

Chrome, Firefox

What version of Bootstrap are you using?

5.3.5

@andybeesee andybeesee changed the title Provide a general summary of the issue Submitting form on input focus (pressing enter) and dropdown is toggled instead of submitting Apr 7, 2025
@mdo mdo added the js label Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants