- Merge request !3243Issue #3333445: Add progress spinner/message functionality to submit buttons → (Open) created by bnjmnm
- Status changed to Closed: outdated
over 1 year ago 11:09am 20 June 2023 - 🇫🇮Finland lauriii Finland
Closing this for now since this is likely not going to help with the Field UX efforts. Still a great idea so we should consider re-opening in future if we find another use case for this.
- 🇬🇧United Kingdom joachim
I think this would be a nice UX addition to various forms. In core, there's the permissions form and the content translation form which are both very slow to submit.
However, I've found a problem with the MR -- when a form's submit button has the '#progress' set, neither the validateForm() nor the submitForm() methods get any values in $form_state->getValues().
- Status changed to Needs work
about 1 year ago 11:40am 20 February 2024 - 🇬🇧United Kingdom joachim
I've had a go at fixing the issue with other non-progress buttons causing the progress-enabled button to get the message.
That works... but with two progress-enabled buttons, the second one gets the message for either of them, so still not quite right :/
Reopening this as I think there's a use case.
- 🇬🇧United Kingdom joachim
> when a form's submit button has the '#progress' set, neither the validateForm() nor the submitForm() methods get any values in $form_state->getValues().
The culprit is this line in the JS
> button.parentNode.innerHTML += throbber;
The moment the button is clicked, all the form elements get their values cleared.
I have no idea why that's happening.
- 🇺🇸United States bnjmnm Ann Arbor, MI
Re #10
I haven't looked at this for a bit, but I recall running into multiple issues when there were DOM changes to the form. This could be mitigated by adding the progress throbber outside of the form, perhaps something like a bar at the top or bottom of the viewport. If we went that route, it may be simplest to not bother with progress messages in this issue's scope as I could see that opening a design rabbit hole that would probably be worthwhile, but not worth blocking some incremental progress.