Skip to content

Commit

Permalink
Update Menu.js (#8769)
Browse files Browse the repository at this point in the history
Fix condition where item is removed from menu before it is attempted to be used in focus calculation.
  • Loading branch information
zentron authored and oliviertassinari committed Oct 20, 2017
1 parent dd45eba commit 77fbba7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ class Menu extends Component {

const filteredChildren = this.getFilteredChildren(this.props.children);
const focusedItem = filteredChildren[focusIndex];
if (focusedItem.props.menuItems && focusedItem.props.menuItems.length > 0) {
if (!!focusedItem && focusedItem.props.menuItems && focusedItem.props.menuItems.length > 0) {
return;
}

Expand Down

0 comments on commit 77fbba7

Please sign in to comment.