Skip to content
This repository has been archived by the owner on Jul 19, 2019. It is now read-only.

New default behavior onMouseOut #301

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vladimir-konnov
Copy link

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

…selected item on mouse out.

Default behavior isn't applied when selectOnBlur prop is true/on in order to have selectOnBlur functionality to work properly
@CMTegner
Copy link
Collaborator

CMTegner commented Feb 4, 2018

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.

@vladimir-konnov
Copy link
Author

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.

@viswanathm
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants