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] Doesn't selects option on click #3566

Closed
w01fgang opened this issue Mar 2, 2016 · 9 comments · Fixed by #3669
Closed

[AutoComplete] Doesn't selects option on click #3566

w01fgang opened this issue Mar 2, 2016 · 9 comments · Fixed by #3669
Labels
component: autocomplete This is the name of the generic UI component, not the React module!

Comments

@w01fgang
Copy link

w01fgang commented Mar 2, 2016

Problem Description

Click with mouse doesn't select option in dropdown menu, the menu closes before filling the field.
I use touchpad on Mackbook, so the tap works well, but the click doesn't.
On documentation site, in v0.15.0-alpha.1, the problem exists.

Possible solution

In auto-complete.js I was found the problem in handleBlur function:

this.timerBlurCloseId = setTimeout(() => {
        this.close();
      }, 0);  // when I change from 0 to 300, click works well

Versions

  • Material-UI: v0.15.0-alpha.1
  • React: 0.14.7
  • Browser: Chrome 48.0.2564.116 (64-bit), Safari 9.0.3
@rynti
Copy link

rynti commented Mar 7, 2016

Experiencing the same issue, any progress on this?

@danpozmanter
Copy link

Same behavior for me in 0.15.0-alpha.1.

@heetvachhani
Copy link
Contributor

@w01fgang thanks for opening this issue. Yes we do have this problem in documentation site.
I checked your solution and it seems to working correctly.
what do you think @mbrookes @newoga?

@mbrookes
Copy link
Member

Invoking @callemall/material-ui, as this is the third or fourth issue lately requiring timers in strange places to solve race events, and it feels like we need a consistent solution.

Ideas anyone?

@oliviertassinari
Copy link
Member

@w01fgang I'm not sure to understand. I don't see any difference when using 300 instead of 0. @heetvachhani Do you have a gif?

@heetvachhani
Copy link
Contributor

@oliviertassinari Yes, Here's gif.

fgp4yqe1nw

screen shot 2016-03-11 at 2 56 21 pm

@oliviertassinari
Copy link
Member

Oh, I get it! I was using my mac touch pad. That explain why I haven't noticed it.
@heetvachhani Thanks.

@w01fgang
Copy link
Author

Yes, it's work if you use Macbook with touchpad, tap works well.
But there is a comment:
The blur event occurs first on a click device and after on a touch device
The popup menu closes before click on them.

setTimeout(() => {
        this.close();
      }, 0);

So, there is no sense to use setTimeout with zero, because the function passed to setTimeout start immediately.

@oliviertassinari
Copy link
Member

That should be fixed by #3669.

@zannager zannager added the component: autocomplete This is the name of the generic UI component, not the React module! label Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

7 participants