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

id setting should apply to the form element too #1144

Open
coreyworrell opened this issue May 17, 2023 · 0 comments
Open

id setting should apply to the form element too #1144

coreyworrell opened this issue May 17, 2023 · 0 comments

Comments

@coreyworrell
Copy link

Description

The default autocomplete form has no id attribute, so you are unable to use external buttons to submit the form (<button form="form-id">Submit</button>).

Reproduction

Preview →

Steps

  1. Enter search term
  2. Press enter on keyboard, see alert popup that form was submitted.
  3. Press escape key on wide screen or click "Cancel" button on narrow screen to hide autocomplete panel
  4. Click "External submit" button to submit the form.
  5. No alert pops up this time.
  6. Manually add the id="form-id" attribute to the generated autocomplete form and click the "External submit" button and see the popup does show.

Expected behavior

The <form> element would receive the passed id. This is also useful when we are replacing an existing form with the autocomplete (JavaScript fallback), which already has an id. So if we can assign the id here, the same button can be used to submit whether it's the fallback form or the autocomplete form.

Environment

  • OS: Linux
  • Browser: Firefox
  • Autocomplete version: 1.9.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant