-
Notifications
You must be signed in to change notification settings - Fork 586
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
inputProps.onBlur not working on mobile #380
Comments
This is a known issue. |
Hey all, The issue is that justSelectedSuggestion is set to true while you scroll and then blocks the .blur() in the onBlur function when you try and blur it afterwards. The displaying of the suggestions is not intrinsically bound to whether the suggestions are focused at the code level. So if justSelectedSuggestion is true then it can't blur. On mousedown sets justSelectedSuggestion to true even if you're just scrolling. But it doesn't properly unset.
This blocking with mousedown and not releasing is also linked to #412 For this specific scroll event, a fix is to do this: Look for these handlers
And add this underneath Yours might look a little different as I'm just working off the dist code. Now add this function below the this.onSuggestionMouseDown function
This means that moving your finger while touching will allow focus again. However to fully fix this blur() blocking it might need some heavy changes or to catch other cases like this. I don't want to assume, since I haven't been able to understand the focusing and blurring side of the code. |
Having the same issue, looking for help |
Hi, I've been digging a little bit into this and have a question. Where the items props are defined a onTouchStart event is defined with the comment:
From what I've experienced this is just partly true. If the item is indicating it is clickable (for example has the style So, a solution to this is to remove the |
Any update on this? It's also a huge blocker for me and I have no way of getting around it on mobile. |
@moroshko Hi, can you please explain why these lines are required? onSuggestionMouseDown = () => {
this.justSelectedSuggestion = true;
}; Looks like they are causing the issue and it's not iOS related. You can reproduce it on desktop:
Suggestion list will remain on the screen and can be removed only by clicking at any suggestion because setTimeout(() => {
this.justSelectedSuggestion = false;
}); UPD: Also looks like it's identical to #412 |
inputProps.onBlur
event fired) when another component is selected.The text was updated successfully, but these errors were encountered: