Skip to content

Commit

Permalink
fix: don't submit form on autocomplete (#3554)
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Bob authored Dec 23, 2024
1 parent 8e7027e commit fdc7856
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/javascript/js/controllers/form_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ import { Controller } from '@hotwired/stimulus'

// Connects to data-controller="form"
export default class extends Controller {
submit() {
submit(event) {
// return if event.key is undefined preventing the form submit on autocomplete event
if (!event.key) return

this.element.requestSubmit()
}
}

0 comments on commit fdc7856

Please sign in to comment.