Skip to content

Commit

Permalink
Merge pull request #4743 from Hybrid-Force/nested-list-toggle-cb
Browse files Browse the repository at this point in the history
[ListItem] Trigger onNestedListToggle callback after state update
  • Loading branch information
oliviertassinari authored Jul 19, 2016
2 parents c06a9fc + 5130b37 commit ce7ee2f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/List/ListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -419,8 +419,9 @@ class ListItem extends Component {

handleNestedListToggle = (event) => {
event.stopPropagation();
this.setState({open: !this.state.open});
this.props.onNestedListToggle(this);
this.setState({open: !this.state.open}, () => {
this.props.onNestedListToggle(this);
});
};

handleRightIconButtonKeyboardFocus = (event, isKeyboardFocused) => {
Expand Down

0 comments on commit ce7ee2f

Please sign in to comment.