React-select: On hover?

Created on 27 Apr 2016  路  8Comments  路  Source: JedWatson/react-select

Is there a way to trigger the drop down on hover rather than click?

Thanks

All 8 comments

There's not a way out of the box.

Though, it seems like you can and by adding an event listener here.

Something like onMouseOver={this.handleMouseDown} should do the trick bc you're trying to replicate the same functionality as onMouseDown. Note, I have not tested this myself.

Hey @gojohnnygo could you please provide an example?
Rendering it with

        onMouseOver={() => {
          console.debug('mouse over')
        }}

prop doesn't call console on mouse over.

If there is no way, would you accept a PR from me which adds a prop shouldToggleOnHover?

@cbrwizard maybe try the following...

  1. Set the openOnFocus prop to true.
  2. Wrap react-select a div that has an onMouseOver handler
  3. In the handler, call focus() on the react-select instance

Also, I don't have merge permissions. :)

What about close the dropdown on blur ???

I need on hover specific option and trigger an event like populate some form fields before select the option. I tried the other way round, select and populate, the selected value disappear. Any suggestion?

I found this and might be helpful to someone.

add this
'&:hover':{
backgroundColor:'#000'
}

Hello -

In an effort to sustain the react-select project going forward, we're closing old issues.

We understand this might be inconvenient but in the best interest of supporting the broader community we have to direct our efforts towards the current major version.

If you aren't using the latest version of react-select please consider upgrading to see if it resolves any issues you're having.

However, if you feel this issue is still relevant and you'd like us to review it - please leave a comment and we'll do our best to get back to you!

Was this page helpful?
0 / 5 - 0 ratings