Skip to content

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

@andybeesee

Description

@andybeesee

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions