-
Notifications
You must be signed in to change notification settings - Fork 585
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
Is onSuggestionFocused actually working? #168
Comments
|
Hi, @moroshko. I'm using autosuggest to render a search song input. |
Can't you use the .playButton {
display: none;
}
.react-autosuggest__suggestion--focused .playButton {
display: inline;
} |
The |
To be more specific, the "display play button" does more than a .control {
transform: scale(0);
transition: transform 100ms ease-in-out;
}
.control.focused {
transform: scale(1);
} It's a specific rule for this component, and if it changes someday, would be nice to just change this component. |
@diegohaz Sorry, I'm not sure I understand the relationship between the Autosuggest component and the "play button". Could you create a Codepen that demonstrates the issue? |
i also need to know which suggestion is focused, how would you recommend doing that? |
ok I've found a workaround for now, but it feels a little hacky. any plan to add the onSuggestionFocused callback? |
Howdy, I also have a use case for this, but also when mouseover causes an item to be "focused". Specifically, I have some meta data sent along with each suggestion object (for example, some extra text to show next to the input box). I want to update that text each time a user focuses on the suggestion. And also remove it when there is nothing focused. Currently, I can get around this by also doing the getSuggestionValue workaround and adding onMouseEnter in renderSuggestion. And a mouseOut of my container component, but would be awesome if this was built in to react-autosuggest. Let me know if you still need a codepen example. |
@emersonyu I hope to free up some time in the next couple of weeks to implement this. This is something I was planning to add to |
Awesome, thanks @moroshko! I may have some time to take a look in the coming weeks too if you aren't able to get around to it. I also noticed some misc (possible) bugs which I'll file a separate issue for. |
I have use case for this, it's same as this http://istarkov.github.io/google-map-react/map/main/ when hover on a suggestion, I want to draw a marker on map which is lat/lng is contained in hovered item |
I was added |
I have problems with a scrollable dropdown. I have:
on I could fix it with Update: I fixed the scrolling moving the styles on the |
I need to know when and which suggestion is focused (not selected yet). I read in old issues that there was a
onSuggestionFocused
property, but It's not documented and I wasn't able to use it.The text was updated successfully, but these errors were encountered: