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.

none option

Successfull submit with no confirm

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.

Command icon 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

roundpanda created an issue. See original summary.

lauriii made their first commit to this issue’s fork.

lauriii’s picture

Priority: Normal » Major
Status: Active » Needs review

Thanks 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.

roundpanda’s picture

That's great! Should we remove the setStatus from WebformContext.Provider that i've added then?

lauriii’s picture

I think we can keep it as is because I think it's fine for us to provide the setStatus in the context.

hooroomoo made their first commit to this issue’s fork.

hooroomoo’s picture

Status: Needs review » Fixed

Looks good to me

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.