Skip to content

Commit

Permalink
Merge pull request #50 from joschect/contextualmenu-submenudismissfix
Browse files Browse the repository at this point in the history
Fixed the submenu's dismissing improperly
  • Loading branch information
joschect authored Aug 8, 2016
2 parents 0e04e10 + 467f875 commit a2e5c0f
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions src/components/ContextualMenu/ContextualMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ export class ContextualMenu extends React.Component<IContextualMenuProps, IConte
beakWidth: 16
};

public refs: {
[key: string]: React.ReactInstance;
};

private _host: HTMLElement;
private _previousActiveElement: HTMLElement;
private _isFocusingPreviousElement: boolean;
Expand Down Expand Up @@ -371,15 +367,8 @@ export class ContextualMenu extends React.Component<IContextualMenuProps, IConte
}

private _onSubMenuDismiss(ev?: any) {
let itemKey = null;
let list = this.refs[this.state.expandedMenuItemKey] as HTMLElement;

if (list && list.contains(ev.target as HTMLElement)) {
itemKey = this.state.expandedMenuItemKey;
}

this.setState({
dismissedMenuItemKey: itemKey,
dismissedMenuItemKey: this.state.expandedMenuItemKey,
expandedMenuItemKey: null,
submenuProps: null
});
Expand Down

0 comments on commit a2e5c0f

Please sign in to comment.