Skip to content

Commit

Permalink
fix: providing onkeydown as a menu method
Browse files Browse the repository at this point in the history
  • Loading branch information
picodoth committed Apr 19, 2018
1 parent 9350e59 commit f16aec7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ const Menu = createReactClass({
this.props.onClick(e);
},

onKeyDown(e, callback) {
this.innerMenu.getWrappedInstance().onKeyDown(e, callback);
},

onOpenChange(event) {
const props = this.props;
const openKeys = this.store.getState().openKeys.concat();
Expand Down Expand Up @@ -196,7 +200,7 @@ const Menu = createReactClass({
}
return (
<Provider store={this.store}>
<SubPopupMenu {...props}>{children}</SubPopupMenu>
<SubPopupMenu {...props} ref={c => this.innerMenu = c}>{children}</SubPopupMenu>
</Provider>
);
},
Expand Down

0 comments on commit f16aec7

Please sign in to comment.