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

[AutoComplete] onNewRequest doesn't fire within iOS devices #4290

Closed
markshust opened this issue May 17, 2016 · 6 comments · Fixed by #5715
Closed

[AutoComplete] onNewRequest doesn't fire within iOS devices #4290

markshust opened this issue May 17, 2016 · 6 comments · Fixed by #5715
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@markshust
Copy link
Contributor

markshust commented May 17, 2016

Problem description

Within the AutoComplete component, the onNewRequest function doesn't execute all the time on iOS devices. It only executes after a long tap/hold of the menu item.

Made a quick video to demonstrate what is going on:
https://youtu.be/XSTk6TeIa24

Steps to reproduce

Implement AutoComplete component with onNewRequest function, and listen for changes on that function. It only executes after a long tap/hold, when it should be executed on any tap. Test on iOS simulator (Cordova app), which returns the same result as a real physical device.

The issue doesn't occur through mobile Safari, just an app built with Cordova.

Versions

  • Material-UI: 0.15.0
  • React: 15.0.2
  • Browser: iOS Simulator (and physical iPhone app)
@markshust
Copy link
Contributor Author

Ok... if I comment out this.close() on this line:
https://github.com/callemall/material-ui/blob/master/src/AutoComplete/AutoComplete.js#L328

The dropdown is properly selected on tap. This appears to be what's causing the issue. Unfortunately, if I do this, of course the PopOver is never closed, so I can't hide the menu options.

It appears that handleBlur is executed before handleItemTouchTap -- this could perhaps be what's causing this issue. It's blurring the menu item before it executes the item tap event, so when the item tap event is executed, the child prop of handleItemTouchTap is empty, so it isn't updated.

markshust added a commit to markshust/material-ui that referenced this issue May 17, 2016
@markshust
Copy link
Contributor Author

Created PR for this. Wrapping close() with a setTimeout fixes this issue.

@masiamj
Copy link

masiamj commented Oct 3, 2016

Still encountering this issue. Anybody else? Using v0.15.4.

@skirunman
Copy link
Contributor

Yes, we need this fix as well. Any updates?

@janowsiany
Copy link
Contributor

Has anyone made a workaround for this issue?

@markshust
Copy link
Contributor Author

@janowsiany the PR I submitted fixes this. I'm not sure why 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: autocomplete This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants