Skip to content

Commit

Permalink
fix: Fixed DropDownMenu onChangeValue callback error
Browse files Browse the repository at this point in the history
  • Loading branch information
myxvisual committed Aug 16, 2017
1 parent bac2e5b commit 8b953aa
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/DropDownMenu/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,8 @@ export class DropDownMenu extends React.Component<DropDownMenuProps, DropDownMen
this.addBlurEvent.cleanEvent();
}

toggleShowList = (e: React.SyntheticEvent<HTMLDivElement>) => {
toggleShowList = (currentValue: string) => {
const { currentValues, showList } = this.state;
const valueNode = e.currentTarget.children[0] as any;
const currentValue = valueNode.innerText;
if (showList) {
currentValues.unshift(...currentValues.splice(currentValues.indexOf(currentValue), 1));
}
Expand Down Expand Up @@ -205,7 +203,7 @@ export class DropDownMenu extends React.Component<DropDownMenuProps, DropDownMen
height: (isCurrent || showList) ? itemHeight : 0,
background: (isCurrent && showList) ? theme.listAccentLow : "none"
}}
onClick={this.toggleShowList}
onClick={() => this.toggleShowList(value)}
onMouseEnter={!showList ? itemAttributes.onMouseEnter : (e) => {
e.currentTarget.style.background = isCurrent ? theme.listAccentMedium : theme.useFluentDesign ? theme.listLow : theme.chromeMedium;
itemAttributes.onMouseEnter(e);
Expand Down

0 comments on commit 8b953aa

Please sign in to comment.