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

onClick, onSelect ignored for DropdownButton #470

Closed
acthp opened this issue Apr 2, 2015 · 5 comments
Closed

onClick, onSelect ignored for DropdownButton #470

acthp opened this issue Apr 2, 2015 · 5 comments
Assignees
Labels

Comments

@acthp
Copy link

acthp commented Apr 2, 2015

Is there a way to be notified when a dropdown is opened? Setting onClick and onSelect appears to have no effect. More generally, is there any documentation of the events emitted by bootstrap components?

@mtscout6
Copy link
Member

mtscout6 commented Apr 2, 2015

It's on our roadmap to address #419.

Although I think you are asking about when the overall dropdown is opened which we are not exposing at the moment.

@acthp
Copy link
Author

acthp commented Apr 2, 2015

Use case is focusing a text input when it opens, similar to the select2 jquery lib. For the moment I'm able to work around it by binding onMouseUp. Not yet sure if it's reliable across different devices.

@lo1tuma
Copy link
Contributor

lo1tuma commented Apr 13, 2015

I was running into the same problem. For my use case I don’t want an onClick handler at all, instead the default event handler should redirect to the URL specified in the href property of the DropdownButton.

@mtscout6
Copy link
Member

I hadn't looked at select2 jquery till today. I'm thinking that the best solution for something like this would be allowing for a custom dropdown menu component aside from the default. So something like:

<DropdownButton>
  <CustomDropdownMenu>
    <MenuItem ... />
    <MenuItem ... />
  </CustomDropdownMenu>
</DropdownButton>

Yet still allow for the default DropdownMenu when none is provided so the following should also work:

<DropdownButton>
  <MenuItem ... />
  <MenuItem ... />
</DropdownButton>

The other issue I see is that the components in select2 jquery are all tied to an actual html5 select box under the covers. I'm not quite sure how to solve that problem, some kind of wrapper that links the two together should work relatively easy.

What are your thoughts on this?

@dozoisch dozoisch added this to the 1.0.0 Release milestone May 3, 2015
@AlexKVal
Copy link
Member

Superceded by #526 and #419

aryad14 pushed a commit to aryad14/react-bootstrap that referenced this issue Oct 11, 2023
…react-bootstrap#470)

* chore(package): update eslint-plugin-jsx-a11y to version 6.2.0

* chore(package): update lockfile package-lock.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants