Problem/Motivation

When a user submits a webform, when there is an error with the submission, focus moves to the top of the page (before the header). The form has an error summary at the top of the page and focus should be set there.

Steps to reproduce

  1. Open webform, fill in fields but leave one required field empty
  2. Submit the form
  3. Note where the focus lands

Observed

Focus lands on the skip link at top of page

Expected

Then the focus lands on the error message at the top of the page

Proposed resolution

CommentFileSizeAuthor
#13 form.gif2.63 MBdanielgry

Comments

fionamorrison23 created an issue. See original summary.

fionamorrison23’s picture

Issue summary: View changes
fionamorrison23’s picture

fionamorrison23’s picture

Version: 1.10.0 » 1.x-dev
fionamorrison23’s picture

Title: WCAG - Focus lands in wrong place upon form submission when error presesnt » WCAG - Focus lands in wrong place upon form submission when error present
fionamorrison23’s picture

fionamorrison23’s picture

Assigned: Unassigned » joshua1234511
joshua1234511’s picture

richardgaunt’s picture

@josh12345 Could you please fix up the failing tests in: https://github.com/civictheme/monorepo-drupal/pull/1443

joshua1234511’s picture

richardgaunt’s picture

Assigned: richardgaunt » danielgry

@danielgry this one is ready to test.

  • 9bbfb982 committed on 1.x
    Issue #3517035 by richardgaunt, joshua1234511, fionamorrison23: WCAG -...
danielgry’s picture

StatusFileSize
new2.63 MB

Verified and tested on dev

Testing results:
1. Verified submitting webforms with at least one invalid field (either empty on required field or incorrect format) takes the user's focus to the error message at the top of the form - PASS
2. Confirmed users can navigate the error message to easily go to the invalid fields - PASS

Screen recording of form focus behaviour

danielgry’s picture

Assigned: danielgry » richardgaunt
Status: Needs review » Reviewed & tested by the community
richardgaunt’s picture

Version: 1.x-dev » 1.13.0
Assigned: richardgaunt » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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