-
Notifications
You must be signed in to change notification settings - Fork 377
chore(Page): add aria label prop to page subcomponents explicitly #7822
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
chore(Page): add aria label prop to page subcomponents explicitly #7822
Conversation
|
Preview: https://patternfly-react-pr-7822.surge.sh A11y report: https://patternfly-react-pr-7822-a11y.surge.sh |
thatblindgeye
left a comment
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.
This looks good! I had a couple of nits below (1 question and 1 suggested change), let me know what you think!
| hasShadowBottom?: boolean; | ||
| /** Flag indicating if the PageBreadcrumb has a scrolling overflow */ | ||
| hasOverflowScroll?: boolean; | ||
| /** Adds an accessible name to the breadcrumb section. Required when the has overflow scroll prop is set to true. */ |
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.
Nit: I know prop descriptions should use sentence case, but I'm wondering if that should apply when referencing other props?
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.
I'm not positive about that myself. I think that having other props in camelCase makes things a bit more clear, but it does conflict with the sentence case prop descriptions guidance as you mentioned. I realize now that some of the other prop descriptions here are already using camelCase.
@tlabaj do you have any thoughts on this?
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.
Same would apply for things like "onChange" and whether that should be written as "on change..." instead within the context of prop descriptions.
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.
I think for a prop name it is ok to deviate from the sentence case standard.
Co-authored-by: Eric Olkowski <70952936+thatblindgeye@users.noreply.github.com>
tlabaj
left a comment
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.
Looks good! Just one comment to be applied to all warnings.
| React.useEffect(() => { | ||
| if (hasOverflowScroll && !ariaLabel) { | ||
| /* eslint-disable no-console */ | ||
| console.warn('An accessible aria-label is required when hasOverflowScroll is set to true.'); |
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.
I would add the component name to warnings to make it easier for consumer to identify what component needs attention.
e.g. "PageBreadcrumb: An accessible aria-label is required when hasOverflowScroll is set to true.'
thatblindgeye
left a comment
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.
🎉
tlabaj
left a comment
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.
LGTM!
|
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Closes #7350
Additional issues: