Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IconMenu] Add #isOpen to IconMenu #1288

Merged
merged 2 commits into from Aug 3, 2015
Merged

[IconMenu] Add #isOpen to IconMenu #1288

merged 2 commits into from Aug 3, 2015

Conversation

JAStanton
Copy link
Contributor

Adds an isOpen method to an iconMenu.

The way I'm using this is that I am programmatically opening / closing the menu from a different user action.

  _toggleMenuState = () => {
    let isOpen = this.refs.menu.isOpen();
    // weird bug https://github.com/callemall/material-ui/issues/1254
    setTimeout(() => {
      if (isOpen) {
        this.refs.menu.close()
      } else {
        this.refs.menu.open()
      }
    }, 1);
  }

There is actually a related bug here: #1254 to make this work.

Adds an isOpen method to an iconMenu. 

The way I'm using this is that I am programmatically opening / closing the menu from a different user action.

```jsx
  _toggleMenuState = () => {
    let isOpen = this.refs.menu.isOpen();
    // weird bug mui#1254
    setTimeout(() => {
      if (isOpen) {
        this.refs.menu.close()
      } else {
        this.refs.menu.open()
      }
    }, 1);
  }
```
There is actually a related bug here: mui#1254 to make this work.
@JAStanton JAStanton changed the title Add #isOpen method to IconMenu Add #isOpen to IconMenu Jul 30, 2015
@JAStanton JAStanton changed the title Add #isOpen to IconMenu [IconMenu] Add #isOpen to IconMenu Jul 30, 2015
hai-cea added a commit that referenced this pull request Aug 3, 2015
[IconMenu] Add #isOpen to IconMenu
@hai-cea hai-cea merged commit 59b69ca into mui:master Aug 3, 2015
@hai-cea
Copy link
Member

hai-cea commented Aug 3, 2015

Thanks @JAStanton

@zannager zannager added component: Icon The React component. component: menu This is the name of the generic UI component, not the React module! labels Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: Icon The React component. component: menu This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants