@tleish The order follows:
-
submit
listener (I throw a debugger in the dist source) turbo-submit-start
I’ve found a workaround in my case following some of the ideas in the Triggering Turbo Frame with JS thread.
- I add
date-turbo: false
to the form - I add a
submit->stripe#submit
handler - Call
preventDefault()
to stop normal browser submission - Check validations
- If valid, manually trigger a form submission.
e.g.
// html
= form_with @object { data: { trubo: :false, action: 'submit->stripe#submit' }
// strip_controller.ts
submit(event) {
event.preventDefault()
if (valid) {
navigator.submitForm(...) //manually trigger form submission (runs events like submit-start & submit-end)
}
}