Problem/Motivation
I encountered an issue with the module in which the input data in a form is not cleared after a user successfully submits the form. This behavior can lead to a confusing user experience, as it may give the impression that the form submission has not been processed, prompting users to submit the same information multiple times inadvertently. This is especially troublesome when confirmation method in Drupal webform configuration is set as none, since there is no indication at all that the form works.


Steps to reproduce
Submit a webform succesfully.
Proposed resolution
I think that in all confirmation methods set in webform configuration the form should clear after a succesfull submit. This provides visual feedback to users, confirming that their submission has been processed, and helps prevent duplicate submissions.
| Comment | File | Size | Author |
|---|---|---|---|
| succesfull_submit_with_no_confirmation_set.jpeg | 16.74 KB | roundpanda | |
| none.jpeg | 9.39 KB | roundpanda |
Issue fork next_webform-3350509
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
lauriiiThanks for the bug report and the MR! 🤩 I 100% agree that this is a massive UX improvement.
I changed the approach in the MR slightly to make sure that we get to keep the status for rendering the selected confirmation message. I also added test coverage for this.
Comment #5
roundpanda commentedThat's great! Should we remove the setStatus from WebformContext.Provider that i've added then?
Comment #6
lauriiiI think we can keep it as is because I think it's fine for us to provide the
setStatusin the context.Comment #8
hooroomooLooks good to me