Description
Description of the issue
My current application had v3.13.1
govuk-frontend JS file and v4.9.0
govuk-frontend npm package. I have recently upgraded both to the latest v5.9.0
.
After updating, my cypress started failing. After investigation I noticed that the reload (command+R) was not clearing the validated field error values on the elements which resulted in test failure. I could ofcourse replicate this manually outside cypress env as well.
Previously, when I reload the page after validation, it used to clear the data from the fields. Has there been any changes made (to forms perhaps) that makes this behave differently now ? I'm just trying to place my finger on the cause.
FYI - no other changes have been made from my side except govuk-frontend update. Outside the update branch, it behaves as expected so it has to do something with the update I believe.
Steps to reproduce the issue
- Visit any page with form fields
- Create a validation error
- Reload the page (command+R)
- The values in the form field(s) persists
Actual vs expected behaviour
Previously, when I reload the page after validation, it used to clear the data from the fields. Its now persisting those values which is breaking some of the tests.
Environment (where applicable)
- Operating system: OSX
- Browser: Chrome
- Browser version: Version 134.0.6998.166 (Official Build) (arm64)
- GOV.UK Frontend Version: 5.9.0