Skip to content

Commit

Permalink
fix(menu): Add missing noop to onClose() & onSelect() callbacks
Browse files Browse the repository at this point in the history
refactor(menu): remove console output

refactor(menu): remove whitespace...
  • Loading branch information
j-o-d-o committed Dec 8, 2017
1 parent 82a5d77 commit 282c0f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Menu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import * as React from 'react';
import { MDCSimpleMenu } from '@material/menu/dist/mdc.menu';
import { List, ListItem } from '../List';
import { simpleTag, withMDC } from '../Base';
import { simpleTag, withMDC, noop } from '../Base';

export const MenuItem = (props: any) => (
<ListItem role="menuitem" tabIndex="0" {...props} />
Expand Down Expand Up @@ -47,6 +47,11 @@ export const Menu = withMDC({
props.onSelected(evt);
}
},
defaultProps: {
open: false,
onSelected: noop,
onClose: noop
},
onUpdate: (props, nextProps, api) => {
if (api && nextProps.open !== undefined && api.open !== nextProps.open) {
api.open = nextProps.open;
Expand Down

0 comments on commit 282c0f4

Please sign in to comment.