-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix Select - active, hover, styling issues on mouseOut #7469
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
Conversation
Signed-off-by: Umesh Verma <umeshiscreative@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -483,6 +490,9 @@ const SelectContainer = forwardRef( | |||
onMouseOver={ | |||
!optionDisabled ? onActiveOption(index) : undefined | |||
} | |||
onMouseOut={ | |||
!optionDisabled ? onResetActiveOption(index) : undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of adding onResetActiveOption
what if we just did something like this instead?
!optionDisabled ? onResetActiveOption(index) : undefined | |
!optionDisabled ? onActiveOption(-1) : undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be better to separate both event actions, but I will refactor it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
What does this PR do?
Has fix for the Hover styling on Select component.
Where should the reviewer start?
components/select/select-container.js
What testing has been done on this PR?
Tested with all the theme levels with storybook
How should this be manually tested?
Do Jest tests follow these best practices?
screen
is used for querying.asFragment()
is used for snapshot testing.Any background context you want to provide?
Reset the onMouse movement
What are the relevant issues?
#7464
Screenshots (if appropriate)
Do the grommet docs need to be updated?
NA
Should this PR be mentioned in the release notes?
NA
Is this change backwards compatible or is it a breaking change?
NA