react-select icon indicating copy to clipboard operation
react-select copied to clipboard

On hover?

Open Mauro74 opened this issue 10 years ago • 8 comments

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

Thanks

Mauro74 avatar Apr 27 '16 15:04 Mauro74

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.

gojohnnygo avatar May 09 '16 15:05 gojohnnygo

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?

fyodoriv avatar Mar 08 '18 13:03 fyodoriv

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

gojohnnygo avatar Mar 09 '18 00:03 gojohnnygo

What about close the dropdown on blur ???

Benornm avatar Jun 21 '18 16:06 Benornm

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?

k8martian avatar Nov 02 '18 18:11 k8martian

I found this and might be helpful to someone.

k8martian avatar Nov 04 '18 17:11 k8martian

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

raidel-dev avatar Nov 29 '18 16:11 raidel-dev

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!

bladey avatar May 28 '20 02:05 bladey