Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't append hash when error summary link clicked
When error summary links are clicked, this adds a hash to the URL. As reported in #1398, if the form is submitted again with further errors, the hash will stop the error summary being focused as should happen and instead the element with the hash ID is scrolled to which is confusing for the user. This behaviour was prevented in GOV.UK Elements but we were not sure at the time why this was necessary so it wasn't reintroduced in GOV.UK Frontend. As we need to use preventDefault() to stop the page scrolling to the form element itself and to show the error message above to make it clear what happened, we programmatically reintroduced the hash to the URL to replicate browser behaviour. Following the bug report #1398, the code that adds the hash is redundant and can be removed. Co-authored-by: Oliver Byford <oliver.byford@digital.cabinet-office.gov.uk>
- Loading branch information