Skip to content

Commit

Permalink
Allow programmatic opening and closing DropDownMenu
Browse files Browse the repository at this point in the history
  • Loading branch information
MrLeebo committed Oct 21, 2015
1 parent ca207c4 commit 3bd5e4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/src/app/components/pages/components/drop-down-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ export default class DropDownMenuPage extends React.Component {
header: 'default: false',
desc: 'Disables the menu.',
},
{
name: 'openImmediately',
type: 'bool',
header: 'default: false',
desc: 'Set to true to have the DropDownMenu automatically open on mount.',
},
],
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/drop-down-menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const DropDownMenu = React.createClass({

getInitialState() {
return {
open: false,
open: this.props.openImmediately,
selectedIndex: this._isControlled() ? null : (this.props.selectedIndex || 0),
muiTheme: this.context.muiTheme ? this.context.muiTheme : ThemeManager.getMuiTheme(DefaultRawTheme),
};
Expand Down

0 comments on commit 3bd5e4c

Please sign in to comment.