Skip to content

Options remain open while clicking other selects #11

@huuuda-aus

Description

@huuuda-aus

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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions