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 (a11): add aria-invalid to career form fields #817

Merged
merged 8 commits into from
Sep 22, 2024

Conversation

virus-rpi
Copy link
Collaborator

@virus-rpi virus-rpi commented Sep 10, 2024

Changes:

  • set aria-invalid to true for all input components if an error message is there
  • add aria-describedby for all input components to the id of the error message element if there is an error
  • add id to all error message elements
  • add aria-labelledby to checkbox if the label is set
  • add id to checkbox label

Note:
Because the useForm is set to mode: 'onSubmit' the aria-invalid flag only changes after the first submit. Changing the mode to 'onChange' would fix that but it would also change the behaviour of the form.

@virus-rpi virus-rpi requested a review from a team as a code owner September 10, 2024 16:02
Copy link

netlify bot commented Sep 10, 2024

Deploy Preview for satellytes ready!

Name Link
🔨 Latest commit 437ca58
🔍 Latest deploy log https://app.netlify.com/sites/satellytes/deploys/66ec43630a5caf0008624f48
😎 Deploy Preview https://deploy-preview-817--satellytes.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 87 (🟢 up 3 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Member

@hofmann-felix hofmann-felix left a comment

Choose a reason for hiding this comment

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

Thank you for taking care of this, works great 💪

However, I think that the implementation can still be improved a little. Could you please take a look at the two comments?

src/components/forms/text-input/text-input.tsx Outdated Show resolved Hide resolved
@hofmann-felix hofmann-felix mentioned this pull request Sep 13, 2024
20 tasks
Copy link
Member

@hofmann-felix hofmann-felix left a comment

Choose a reason for hiding this comment

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

Works nice 🙌

Copy link
Member

@hofmann-felix hofmann-felix left a comment

Choose a reason for hiding this comment

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

I just noticed that all fields have the aria-required={true} attribute even if they are not required. Can you please fix this in the scope of this PR?

Copy link
Member

@hofmann-felix hofmann-felix left a comment

Choose a reason for hiding this comment

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

Awesome 🚀

@virus-rpi virus-rpi merged commit 8c90534 into main Sep 22, 2024
6 checks passed
@virus-rpi virus-rpi deleted the chore/a11y/career/form branch September 22, 2024 21:26
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.

2 participants