-
Notifications
You must be signed in to change notification settings - Fork 7
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
Axe context #98
Axe context #98
Conversation
* @see https://www.deque.com/axe/core-documentation/api-documentation/#context-parameter | ||
*/ | ||
get context() { | ||
return this.parameters.context; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is checked elsewhere, but is .parameters
guaranteed to exist here? (assuming typescript would be complaining if not)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's initialized in this object's constructor
context: normalizeContext(rawStory.parameters?.axe?.context, rawStory) as | ||
| Context | ||
| undefined, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note the as
. I didn't feel like creating a Zod schema for all the permutations the context object can take, so left it just checking the general shape.
Thanks 🙏 |
Add a parameter for Axe context. #53
Useful for excluding parts of the page.