Skip to content

Commit 15ac1b7

Browse files
gleknerjeff-phillips-18
authored andcommitted
feat(ListViewItem): Add initialExpand prop to ListViewItem (#1114)
feat(ListViewItem): Add initialExpand prop to ListViewItem
1 parent 59ca4e9 commit 15ac1b7

File tree

1 file changed

+4
-1
lines changed
  • packages/patternfly-3/patternfly-react/src/components/ListView

1 file changed

+4
-1
lines changed

packages/patternfly-3/patternfly-react/src/components/ListView/ListViewItem.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import ListViewRow from './ListViewRow';
1515
* renders ListViewGroupItemHeader and ListViewGroupItemContainer
1616
*/
1717
class 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
};

0 commit comments

Comments
 (0)