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

Radio component a11y fixes #2562

Merged
merged 13 commits into from Jan 5, 2024
Merged

Radio component a11y fixes #2562

merged 13 commits into from Jan 5, 2024

Conversation

it-vegard
Copy link
Contributor

Remove aria-invalid from individual Radio components because it is placed on the FieldSet

Description

Change summary

PR Checklist 📝 (Remove fields after check!)

New component? ✨

  • Check that component-styling is correctly configured in @navikt/core/css/config/_mappings.js. This is needed for correct build and CDN upload.
  • Check that styling is correctly exported from @navikt/core/css/index.css
  • Check that correct tokens for component is documented in @navikt/core/css/tokens.json
  • Check that only needed components and types are exported from @navikt/core/react/src/index.ts
  • Add JSDoc to component (see other components for reference)
  • Create storybook-stories for relevant component variations and compositions. Stories are used for visual regression testing, so make sure they are complete.
  • Is the component sufficiently complex to warrant tests? Add some unit-tests for jest.

Component-updates 🎉

  • Revalidate if everything under New component is still accounted for
  • Deprecating/removing a CSS class? Add it to @navikt/aksel-stylelint/src/deprecations.ts with a suitable description. This helps stylelint-users keep their code clean and bug-free.

Documentation 📝

  • Add/update component-demos for component aksel.nav.no/website/pages/eksempler
  • Create/Update documentation in sanity if needed
    Note: Props, tokens and examples only updates to sanity on merge to main

Versioning 🏷️

  • Run yarn changeset to generate a version-entry for change.
    • Bug/hotfix: Patch
    • New feature: Minor
    • Breaking change: Major
  • Adding breaking changes? Consider adding a codemod for easier migration.
  • Breaking changes also needs documentation under "Migration"-page on website

Copy link

changeset-bot bot commented Dec 13, 2023

🦋 Changeset detected

Latest commit: 09fda11

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 7 packages
Name Type
@navikt/ds-react Patch
@navikt/ds-css Patch
@navikt/ds-tokens Patch
@navikt/ds-tailwind Patch
@navikt/aksel-icons Patch
@navikt/aksel Patch
@navikt/aksel-stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Dec 13, 2023

Storybook demo

Endringer til review: 2

2bf664833 | 61 komponenter | 400 stories

…creen reader

When using multiple elements (span, etc) inside of a label, each one will be added as a screen reader "stop" and announced both as part of the label and as a separate text element.
Using this technique overrides this, to create the same experience as if the was only text inside of the label (native-like).
@@ -70,7 +70,7 @@ export const Fieldset = forwardRef<HTMLFieldSetElement, FieldsetProps>(
>
<fieldset
{...omit(rest, ["errorId", "error", "size", "readOnly"])}
{...inputProps}
{...omit(inputProps, ["aria-invalid"])}
Copy link
Contributor Author

@it-vegard it-vegard Dec 21, 2023

Choose a reason for hiding this comment

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

Denne påvirker bare CheckboxGroup og RadioGroup i våre komponenter, men er vi bekymret over at andre har brukt Fieldset og ikke koblet feilmelding til komponenten? 🤔 Vi tar bort aria-invalid fordi den er redundant når vi har feilmelding koblet til Fieldset/input.

Copy link
Collaborator

@KenAJoh KenAJoh Dec 21, 2023

Choose a reason for hiding this comment

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

men er vi bekymret over at andre har brukt Fieldset og ikke koblet feilmelding til komponenten?

Vil denne endringen gjør de løsningene som ikke har gjort det enda værre en før? Så de går fra dårlig -> dårligere?

@KenAJoh
Copy link
Collaborator

KenAJoh commented Jan 4, 2024

Ser ut som å endre

export function useId(idOverride?: string): string | undefined

til

export function useId(idOverride?: string): string

Løser feilen 🤔 @it-vegard

Edit: Laget en PR på det #2589

@it-vegard it-vegard marked this pull request as ready for review January 5, 2024 11:05
Copy link
Collaborator

@KenAJoh KenAJoh left a comment

Choose a reason for hiding this comment

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

🔥

@it-vegard it-vegard merged commit 7a743b5 into main Jan 5, 2024
2 checks passed
@it-vegard it-vegard deleted the bugfix/radio-a11y-fixes branch January 5, 2024 11:31
@github-actions github-actions bot mentioned this pull request Jan 5, 2024
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

2 participants