Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove appending hash behaviour when error summary link clicked #1435

Merged
merged 3 commits into from
Jun 6, 2019

Commits on Jun 6, 2019

  1. 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 <[email protected]>
    hannalaakso and 36degrees committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    f13fe1f View commit details
    Browse the repository at this point in the history
  2. Update changelog

    hannalaakso committed Jun 6, 2019
    Configuration menu
    Copy the full SHA
    b1d0990 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e43c04a View commit details
    Browse the repository at this point in the history