forked from hotwired/turbo
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Render progress bar during form submissions
Closes hotwired#61 Closes hotwired#147 --- Extends the `Adapter` interface to support new `formSubmissionStarted(FormSubmission)` and `formSubmissionFinished(FormSubmission)` delegate methods to hook into a page's form submission lifecycle. Making the Adapter aware of form submissions provides an opportunity to show and hide the progress bar in the same way as driving the page with Visits. Additionally, replace the `HTMLDivElement` implementation of the progress bar with a [progress][] element and an instance of [HTMLProgressElement][]. When updating the progress, set the `HTMLProgressElement.value` attribute, and let the browser-native implementation update its width. Since the element's `value` attribute is accessible via a property, we no longer have to synchronize via `requestAnimationFrame()`. To support the built-in element, there are some proprietary pseudoelements to consider across the browsers, including: * [-moz-progress-bar][] for the Firefox bar * [-webkit-progress-bar][] for the Safari and Chrome bar background * [-webkit-progress-value][] for the Safari and Chrome bar progress * [-ms-fill][] for IE bars [progress]: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/progress [HTMLProgressElement]: https://developer.mozilla.org/en-US/docs/Web/API/HTMLProgressElement [-moz-progress-bar]: https://developer.mozilla.org/en-US/docs/Web/CSS/::-moz-progress-bar [-webkit-progress-bar]: https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-progress-bar [-webkit-progress-value]: https://developer.mozilla.org/en-US/docs/Web/CSS/::-webkit-progress-value [-ms-fill]: https://developer.mozilla.org/en-US/docs/Archive/Web/CSS/::-ms-fill
- Loading branch information
1 parent
57a118e
commit 76e2307
Showing
10 changed files
with
114 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters