-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[added] accessibility props for PanelGroup and Panels. #1191
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
[added] accessibility props for PanelGroup and Panels. #1191
Conversation
Signed-off-by: Kenny Wang <[email protected]>
Oops. Forgot PropType validation. I'm also not sure if these roles should be exposed. |
@@ -166,7 +174,7 @@ const Panel = React.createClass({ | |||
if (this.props.collapsible) { | |||
header = cloneElement(header, { | |||
className, | |||
children: this.renderAnchor(header.props.children) | |||
children: this.renderAnchor(header.props.children, headerRole) |
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.
Would it be incorrect for the header role to actually get attached to the "heading" element at https://github.com/react-bootstrap/react-bootstrap/pull/1191/files#diff-1e26d9c69579835d9b0137815187fafeR185 rather than the anchor?
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.
The use-case we're anticipating here is using an accordion like a set of tabs, as in the example in the react-bootstrap documentation. Based on our research, the a
is the correct place to put the role attribute. Here's one blog post that confirms this.
BTW, would appreciate seeing your thoughts on discussion on #983 from #983 (comment) on down, i.e. we might structure <Panel>
<Panel.Heading>{heading}</Panel.Heading>
<Panel.Body>{body}</Panel.Body>
</Panel> and then this would just work with the |
Signed-off-by: Dominick Reinhold <[email protected]> Signed-off-by: Matt Royal <[email protected]>
20bf427
to
adad32e
Compare
@mattroyal and I just amended the last commit to add Edited to add: Just looking at #983 now and seeing that it addresses this issue. I left some thoughts on changing the API. |
LGTM. Might make sense to squash these commits. Otherwise |
LGTM |
[added] accessibility props for PanelGroup and Panels.
Adds accessibility, following the guideline specified here.
The Pivotal UI Team
@atomanyih @ctaymor @d-reinhold @kennyw12 @matt-royal @nicw @stubbornella