Skip to content

Commit

Permalink
Merge pull request #205 from flavio-b/patch-2
Browse files Browse the repository at this point in the history
Correct event.detail properties of `turbo:submit-end`
  • Loading branch information
dhh authored Sep 16, 2024
2 parents 2648c0c + 4bfe25d commit f56a902
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions _source/reference/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,12 @@ Fires during a form submission. Access the [FormSubmission][] object with `event

Fires after the form submission-initiated network request completes. Access the [FormSubmission][] object with `event.detail.formSubmission` along with the properties included within `event.detail`.

| `event.detail` property | Type | Description
|---------------------------|-------------------------------|------------
| `formSubmission` | [FormSubmission][] | the `<form>` element submission
| `success` | `boolean` | a `boolean` representing the request's success
| `fetchResponse` | [FetchResponse][] \| `null` | present when `success: true`, `null` when `success: false`
| `error` | [Error][] or `null` | `null` when `success: true`, present when `success: false`
| `event.detail` property | Type | Description
|---------------------------|----------------------------------|------------
| `formSubmission` | [FormSubmission][] | the `<form>` element submission
| `success` | `boolean` | a `boolean` representing the request's success
| `fetchResponse` | [FetchResponse][] \| `undefined` | present when a response is received, even if `success: false`. `undefined` if the request errored before a response was received
| `error` | [Error][] \| `undefined` | `undefined` unless an actual fetch error occurs (e.g., network issues)

[Error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors
[FormSubmission]: /reference/drive#formsubmission
Expand Down

0 comments on commit f56a902

Please sign in to comment.