File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
packages/patternfly-3/patternfly-react/src/components/ListView Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ import ListViewRow from './ListViewRow';
1515 * renders ListViewGroupItemHeader and ListViewGroupItemContainer
1616 */
1717class ListViewItem extends React . Component {
18- state = { expanded : false } ;
18+ state = { expanded : this . props . initExpanded } ;
1919 toggleExpanded = ( ) => {
2020 const { onExpand, onExpandClose } = this . props ;
2121 if ( this . state . expanded ) {
@@ -127,6 +127,8 @@ ListViewItem.propTypes = {
127127 compoundExpand : PropTypes . bool ,
128128 /** Flag to show compound expansion contents */
129129 compoundExpanded : PropTypes . bool ,
130+ /** Flag to initialize expanded state */
131+ initExpanded : PropTypes . bool ,
130132 /** Function triggered when compound expandable content is closed */
131133 onCloseCompoundExpand : PropTypes . func
132134} ;
@@ -143,6 +145,7 @@ ListViewItem.defaultProps = {
143145 hideCloseIcon : false ,
144146 onExpand : noop ,
145147 onExpandClose : noop ,
148+ initExpanded : false ,
146149 onCloseCompoundExpand : noop ,
147150 stacked : false
148151} ;
You can’t perform that action at this time.
0 commit comments