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

fix(PPDSC-2164): assistive text #249

Merged
merged 5 commits into from
Jul 1, 2022
Merged

Conversation

mstuartf
Copy link
Contributor

PPDSC-2164

What

  1. Background:
  • aria-describedby for a form input is set to the id of the assistive text element, which is assumed to be present.
  • If no assistive text element is present, aria-describedby references a non-existent element.
  1. What did you do:
  • Updated the assistive text id value in the form input's context from within the AssistiveText component.
  • This way the context will only contain an assistive text id if there is an assistive text element present, so aria-describedby will not be set incorrectly.
  • Tests for the above.
  1. What does the reviewers should expect:
  • aria-describedby for a form input should not be set if there is no assistive text element present.

I have done:

  • Written unit tests against changes
  • Written functional tests against the component and/or NewsKit site
  • Updated relevant documentation

I have tested manually:

  • The feature's functionality is working as expected on Chrome, Firefox, Safari and Edge
  • The screen reader reads and flows through the elements as expected.
  • There are no new errors in the browser console coming from this PR.
  • When visual test is not added, it renders correctly on different browsers and mobile viewports (Safari, Firefox, small mobile viewport, tablet)
  • The Playground feature is working as expected

mstuartf added 2 commits June 30, 2022 16:18
- Update assistiveTextId context value inside AssistiveText component so that it is only set if this component exists within the parent.
@github-actions github-actions bot added the fix This change fixes a bug label Jun 30, 2022
@newskit-engineering
Copy link
Collaborator

@mstuartf mstuartf merged commit 4fbda6c into main Jul 1, 2022
@mstuartf mstuartf deleted the fix/PPDSC-2164-assistive-text branch July 1, 2022 16:56
Xin00163 pushed a commit that referenced this pull request Oct 17, 2022
* fix(PPDSC-2164): add tests for bug expected outcome

* fix(PPDSC-2164): do not set aria-describedby if no assistive text

- Update assistiveTextId context value inside AssistiveText component so that it is only set if this component exists within the parent.

* fix(PPDSC-2164): update failing fieldset snapshots
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix This change fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants