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

WSTEAM1-975: Update ARIA Attributes #11626

Merged
merged 7 commits into from
May 16, 2024
Merged

WSTEAM1-975: Update ARIA Attributes #11626

merged 7 commits into from
May 16, 2024

Conversation

shayneahchoon
Copy link
Contributor

Resolves JIRA WSTEAM1-975

Overall changes

Updates components to populate these aria attributes dynamically:

  • aria-required
  • aria-describedby
  • aria-invalid

Code changes

  • FormContext changed to store the number of times a user has attempted a submission.
  • FormField state changed to store whether a user has previously made and invalid entry.
  • FormComponents updated to include said dynamic attributes.

Testing

  1. List the steps used to test this PR.

Helpful Links

Add Links to useful resources related to this PR if applicable.

Coding Standards

Repository use guidelines

Copy link
Contributor

@Isabella-Mitchell Isabella-Mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heya - looks good! I just checked the storybook permalink with a screen reader and it sounds good too!

There is one thing that looks to be missing - but it might be outside of the scope of this ticket. We should be indicating optional fields via the label text as per the GEL guidelines (So required fields are only known to the user on submission via an error message, but optional fields are known to the user in the default state via the label text).

Is this easy to add? Or should we flag to Harry this needs to be a follow up task?

@shayneahchoon
Copy link
Contributor Author

Heya - looks good! I just checked the storybook permalink with a screen reader and it sounds good too!

There is one thing that looks to be missing - but it might be outside of the scope of this ticket. We should be indicating optional fields via the label text as per the GEL guidelines (So required fields are only known to the user on submission via an error message, but optional fields are known to the user in the default state via the label text).

Is this easy to add? Or should we flag to Harry this needs to be a follow up task?

Heya, yessss I was going to ask Harry about it, because the GEL Guidelines say that the optional field should be indicated in the label itself, rather than using the 'required' attribute. So I'm not sure if that's something to do with editorial instead of Simorgh itself.

@Isabella-Mitchell
Copy link
Contributor

Heya - looks good! I just checked the storybook permalink with a screen reader and it sounds good too!
There is one thing that looks to be missing - but it might be outside of the scope of this ticket. We should be indicating optional fields via the label text as per the GEL guidelines (So required fields are only known to the user on submission via an error message, but optional fields are known to the user in the default state via the label text).
Is this easy to add? Or should we flag to Harry this needs to be a follow up task?

Heya, yessss I was going to ask Harry about it, because the GEL Guidelines say that the optional field should be indicated in the label itself, rather than using the 'required' attribute. So I'm not sure if that's something to do with editorial instead of Simorgh itself.

Thanks for bringing this up in standup - can see we have another subtask for this so we can cover that there. :)

Copy link
Contributor

@amoore108 amoore108 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work here 🙏 Thanks for taking this on, definitely a tricky one to solve but sets us up really well for the error UX stuff!

@shayneahchoon shayneahchoon merged commit 8b21b01 into latest May 16, 2024
11 checks passed
@shayneahchoon shayneahchoon deleted the WSTEAM1-975-ARIA branch May 16, 2024 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants