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

New default behavior onMouseOut

Open vladimir-konnov opened this issue 8 years ago • 3 comments

Hello all!

I would like to propose new default behavior when user moves mouse out of the dropdown box: remove highlighting from last selected item. People are asking why the highlighting stays when you move mouse out of options list. I think it was done on purpose for the sake of selectOnBlur functionality. But now there's no ability to change this behaviour, no option in props list. So I'm proposing to remove highlighting by default when selectOnBlur is off.

Thank you

P.S. Though I proposed this as a default behavior, you'd probably like to add an option into props list to handle it explicitly. I'm also ok with that

vladimir-konnov avatar Dec 20 '17 12:12 vladimir-konnov

Hi Vladimir! Wouldn't it be better to have this behaviour trigger when the cursor leaves the menu, and not each individual item? I haven't traced the code, but I think this change will cause twice as many state changes when the user's cursor moves between items.

CMTegner avatar Feb 04 '18 09:02 CMTegner

Hi CMTegner! I proposed this code in order to fix the case when user moves the cursor out of a menu item, the same like it highlights a menu item onMouseEnter. Well, from performance point of view I agree with you, it would be better to remove highlighting on mouse leaving the menu itself, not just a menu item. For the first glance it should work ok if you move the handler from menu item to menu itself.

vladimir-konnov avatar Feb 04 '18 19:02 vladimir-konnov

Hi, I agree with Vladmir. I am using this control and facing some problem of not removing highlighted index on mouse out.

And moving mouseOut event from menu item to menu would improve the performance too.

When will this pull request be merged? I can probably move the mouseOut to menu from menuItem and raise new pull request.

It would be great if this can be addressed at the earliest.

viswanathm avatar Mar 29 '18 12:03 viswanathm