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

Addon-a11y: Fix type of context passed to axe.run #16129

Merged
merged 1 commit into from
Oct 4, 2021

Conversation

kaelig
Copy link
Contributor

@kaelig kaelig commented Sep 22, 2021

What I did

According to axe's API reference, the context passed to axe.run can be a NodeList, but the addon-a11y is passing an HTMLCollection.

Screen Shot 2021-09-22 at 10 49 02 AM

This PR ensures we're passing a NodeList and shouldn't impact functionality.

Related: dequelabs/axe-core#3161

How to test

  • Is this testable with Jest or Chromatic screenshots?
  • Does this need a new example in the kitchen sink apps?
  • Does this need an update to the documentation?

If your answer is yes to any of these, please make sure to include it in your PR.

@nx-cloud
Copy link

nx-cloud bot commented Sep 22, 2021

Nx Cloud Report

CI ran the following commands for commit cbc2388. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@shilman
Copy link
Member

shilman commented Sep 23, 2021

cc @MichaelArestad

@kaelig
Copy link
Contributor Author

kaelig commented Sep 24, 2021

By the way, what's this code supposed to do?

const storyRoot = document.getElementById('story-root');

Is #story-root a thing?

If this is only related to this addon, should it be documented?

@kylegach
Copy link
Contributor

By the way, what's this code supposed to do?

const storyRoot = document.getElementById('story-root');

Is #story-root a thing?

Not that I could find: https://github.com/storybookjs/storybook/search?q=story-root 🤷‍♂️

Copy link
Contributor

@kylegach kylegach left a comment

Choose a reason for hiding this comment

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

This change LGTM, though we may wish to simplify what may be un-needed code in a later effort (see: #16129 (comment)).

Thanks, @kaelig!

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

I filed a follow-up issue to remove #story-root, since we couldn't figure out what that is or what it's supposed to do. Merging this now! Thanks @kaelig !!! 🙏

@shilman shilman changed the title [addon-a11y] Fix type of context passed to axe.run Addon-a11y: Fix type of context passed to axe.run Oct 4, 2021
@shilman shilman merged commit 2510d26 into storybookjs:next Oct 4, 2021
@shilman shilman added this to the 6.4 PRs milestone Oct 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants