diff --git a/common/changes/office-ui-fabric-react/master_2018-05-08-02-09.json b/common/changes/office-ui-fabric-react/master_2018-05-08-02-09.json new file mode 100644 index 0000000000000..c131957538deb --- /dev/null +++ b/common/changes/office-ui-fabric-react/master_2018-05-08-02-09.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "BaseButton: Allow Alt + Down on menu buttons to open the menu", + "type": "patch" + } + ], + "packageName": "office-ui-fabric-react", + "email": "chiechan@microsoft.com" +} \ No newline at end of file diff --git a/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx b/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx index 2363f38db1e71..895d5194fa414 100644 --- a/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx +++ b/packages/office-ui-fabric-react/src/components/Button/BaseButton.tsx @@ -450,7 +450,7 @@ export class BaseButton extends BaseComponent { if (this.props.menuProps) { - const menuProps = {...this.props.menuProps, shouldFocusOnContainer: shouldFocusOnContainer }; + const menuProps = { ...this.props.menuProps, shouldFocusOnContainer: shouldFocusOnContainer }; if (this.props.persistMenu) { menuProps.hidden = false; } @@ -679,13 +679,13 @@ export class BaseButton extends BaseComponent): boolean { if (this.props.menuTriggerKeyCode) { return ev.which === this.props.menuTriggerKeyCode; - } else { - if (this._isSplitButton) { - return ev.which === KeyCodes.down && (ev.altKey || ev.metaKey); - } else { - return ev.which === KeyCodes.enter; - } + } else if (this.props.menuProps) { + return ev.which === KeyCodes.down && (ev.altKey || ev.metaKey); } + + // Note: When enter is pressed, we will let the event continue to propagate + // to trigger the onClick event on the button + return false; } private _onMenuClick = (ev: React.MouseEvent) => {