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

Open State #41

Closed
msimonc opened this issue Mar 6, 2016 · 3 comments
Closed

Open State #41

msimonc opened this issue Mar 6, 2016 · 3 comments

Comments

@msimonc
Copy link

msimonc commented Mar 6, 2016

Thanks again for this,

for isOpen, if the default value is false,

is <Menu isOpen /> the same as <Menu isOpen={true}/> and

<Menu /> the same as <Menu isOpen={false}/>

can't get either working for some reason. My current workaround (in an onClick handler for each element) is:

        const clickEvt = new MouseEvent("click", {
            view: window,
            bubbles: true,
            cancelable: true
        });
        var crossButton = document.getElementsByClassName('bm-overlay');
        try {
            crossButton[0].dispatchEvent(clickEvt);
        } catch(err) {}

This closes the menu after an item has been selected.

@negomi
Copy link
Owner

negomi commented Mar 7, 2016

Hey @msimonc, I'm not sure I understand your description - it seems like something didn't paste quite right? :)

@msimonc
Copy link
Author

msimonc commented Mar 7, 2016

Fixed up the egregious original cut / pasting :)

@negomi
Copy link
Owner

negomi commented Mar 8, 2016

Thanks :)

There was actually a bug preventing the isOpen prop from working as intended, but you're correct that that's how it should work. If you update to version 1.5.4, it should now be fixed.

@negomi negomi closed this as completed Mar 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants