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

Options remain open while clicking other selects #11

Open
huuuda-aus opened this issue Jan 22, 2016 · 0 comments
Open

Options remain open while clicking other selects #11

huuuda-aus opened this issue Jan 22, 2016 · 0 comments

Comments

@huuuda-aus
Copy link

I'm not sure why it happened in my project - the dropdown behaviour has been logical and straightforward and peachy and all - until I did the following:

  • click the select (button)
  • the list of options will be shown
  • click another select
  • the list of this select's options will be shown BUT the previous list will not be closed

I ended up with 6 opened dropdowns until I picked an option or clicked somewhere else.

Found out you just need to comment out the e.stopPropagation() in the button click handler:

    button.click(function (e) {
      e.stopPropagation();
      self.setState({ open: !self.state.open });
    });

which will close all potential opened dropdowns before opening the clicked one.

Apologies for my clumsy explanation. I hope you get what I mean :)

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

1 participant