File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import PropTypes from 'prop-types';
4
4
5
5
export class Collapse extends React . Component {
6
6
static propTypes = {
7
+ accessibilityId : PropTypes . string ,
7
8
theme : PropTypes . shape ( {
8
9
collapse : PropTypes . string ,
9
10
content : PropTypes . string
@@ -21,6 +22,7 @@ export class Collapse extends React.Component {
21
22
22
23
23
24
static defaultProps = {
25
+ accessibilityId : '' ,
24
26
theme : {
25
27
collapse : 'ReactCollapse--collapse' ,
26
28
content : 'ReactCollapse--content'
@@ -164,10 +166,14 @@ export class Collapse extends React.Component {
164
166
165
167
166
168
render ( ) {
167
- const { theme, children} = this . props ;
169
+ const { accessibilityId , theme, children, isOpened } = this . props ;
168
170
return (
169
- < div ref = { this . onRefContainer } className = { theme . collapse } style = { this . initialStyle } >
170
- < div ref = { this . onRefContent } className = { theme . content } >
171
+ < div
172
+ ref = { this . onRefContainer }
173
+ className = { theme . collapse }
174
+ style = { this . initialStyle }
175
+ aria-hidden = { ! isOpened } >
176
+ < div ref = { this . onRefContent } className = { theme . content } id = { accessibilityId } >
171
177
{ children }
172
178
</ div >
173
179
</ div >
You can’t perform that action at this time.
0 commit comments