adobe / aem-core-wcm-components

Standardized components to build websites with AEM.
https://docs.adobe.com/content/help/en/experience-manager-core-components/using/introduction.html
Apache License 2.0
724 stars 737 forks source link

Form prefill on failed submission loses submitted text value when default present #2805

Open HitmanInWis opened 4 days ago

HitmanInWis commented 4 days ago

Bug present as of version: 2.24.7-SNAPSHOT

When a form submission fails, values in text fields should be preserved. They are indeed preserved, unless a text field has a default value specified.

So if I have: Name: [ ] Company: [ ]

and user submits a failed request of

Name: [Brett] Company: [NewCo]

and that request fails, the form is restored as:

Name: [Brett] Company: [NewCo]

But if my form starts as:

Name: [ ] Company: [Adobe]

and user submits a failed request of

Name: [Brett] Company: [NewCo]

the form is restored incorrectly as:

Name: [Brett] Company: [Adobe]