Skip to content

Conversation

miqh
Copy link
Contributor

@miqh miqh commented Oct 12, 2022

Hello there,

This should fix up the accessibility violations reported across some of the FileInput stories.

It seems like using a label element, explicit or implicit, appears to be the preferred way to work around such violations. In the interest of preserving the existing story visuals, I opted for aria-label. If the former is more desirable, I can update my changes.


What does this PR do?

Resolve accessibility violations for FileInput stories.

Where should the reviewer start?

Changes are confined to the file input stories reporting violations.

What testing has been done on this PR?

Confirmed the violations no longer appear in the Storybook.

How should this be manually tested?

As above.

Do Jest tests follow these best practices?

N/A.

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • userEvent is used in place of fireEvent.
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

None.

What are the relevant issues?

Refer to #6124.

Screenshots (if appropriate)

N/A.

Do the grommet docs need to be updated?

Don't think so.

Should this PR be mentioned in the release notes?

Up to maintainers to decide.

Is this change backwards compatible or is it a breaking change?

Should have no impact on consumers of the library.

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

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

This looks good, can we also add an aria-label to the FileInput/Custom/CustomThemed story as well? I know it was left out from the issue description checklist but just happened to notice it while I was reviewing.

@miqh
Copy link
Contributor Author

miqh commented Oct 12, 2022

@jcfilben, can do.

Until now that you've pointed out, I didn't even notice the theme switcher option in Storybook. My bad!

A quick look after, it seems like there are additional colour contrast violations in the "hpe" theme. What's your preferred approach with resolving these for now given that any colour tweaks will affect component consumers?

@jcfilben
Copy link
Collaborator

Good catch on the hpe theme! For now let's just leave the hpe ones as they are. I will bring the issue up with other members of the grommet team and we can decide how to move forward on the hpe theme issue, but don't worry about it for now in this pull request.

@miqh
Copy link
Contributor Author

miqh commented Oct 13, 2022

@jcfilben, got it.

Beyond FileInput, there are other components which exhibit that colour contrast violation (though I'm sure you're probably already aware). If you reach a consensus on what to do about that, then those violations can hopefully be dealt with in a uniform manner as well.

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

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

Looks good!

@ericsoderberghp ericsoderberghp merged commit aad44bf into grommet:master Oct 13, 2022
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.

3 participants