Skip to content
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

Fixes sticky suggestions for touch devices #417

Closed
wants to merge 10 commits into from
Closed

Conversation

d-a-n
Copy link

@d-a-n d-a-n commented Aug 3, 2017

When scrolling on the suggestion list with touch devices and the input looses focus, the suggestions don't disappear as expected.

Fixes #412 #380

@d-a-n d-a-n changed the title Fixes sticky suggestions for touch devices #412 Fixes sticky suggestions for touch devices Aug 3, 2017
@moroshko
Copy link
Owner

moroshko commented Aug 3, 2017

Thanks for this!

Does this really fix #412?
Isn't onTouchEnd a mobile only thing?
Did you test this repro on desktop?

@d-a-n
Copy link
Author

d-a-n commented Aug 3, 2017

@moroshko Thanks for you fast reply. I've pushed the missing part ;)

When the mouse button is pressed and leaves the container the input gets the focus again.

ezgif-4-a285126844

@moroshko
Copy link
Owner

moroshko commented Aug 5, 2017

@d-a-n I deployed your version here, but it doesn't seem to behave as expected. Specifically:

  1. In #412 repro, the last bit doesn't work:

Clicking outside of the autosuggest closes the suggestions.

  1. inputProps.onBlur not working on mobile #380 -Trying to click outside of the autosuggest on iOS, doesn't close the suggestions list. It works on desktop, but not on iOS (tested on iPhone 6+ Chrome).

@d-a-n
Copy link
Author

d-a-n commented Aug 11, 2017

@moroshko Thanks for pointing this out.

I've fixed Clicking outside of the autosuggest closes the suggestions. from #412.

Regarding blurring the the input on touch devices when a users clicks outside: This could be done too but atm it reflects the default browser behavior. I would not change this. Probably most of the users will use the keyboards done or enter key to dismiss the suggestion list anyways. What do you think?

@moroshko
Copy link
Owner

@d-a-n

#412
Check out The Multiple sections example here.
We have highlightFirstSuggestion={true} in this example.
The problem is that, with your changes, the first suggestion is highlighted after you drag a suggestion. We should not highlight the first suggestion in this case.

#380
I'm not saying we should blur the input when user clicks outside. I'm saying that the suggestions list needs to be closed. I'm OK with leaving the input focused.
If you still want to fix this, I suggest to create a separate PR for #380.

@jacobweber
Copy link

Ran into this too.

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

Successfully merging this pull request may close these issues.

3 participants