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

MdAutocomplete not opening and closing correctly in cases of no options to display #5910

Closed
donaldvenus opened this issue Jul 20, 2017 · 3 comments · Fixed by #5911
Closed
Assignees

Comments

@donaldvenus
Copy link

Bug, feature request, or proposal:

Bug

What is the expected behavior?

When the user clicks away and then refocuses on an input element that has no autocomplete options to display and then changes the input until new options should display, the autocomplete panel should open and show these options.

What is the current behavior?

When the user clicks away and then refocuses on an input element that has no autocomplete options to display and then changes the input until new options should display, the autocomplete panel does not open. Additionally, if after this the user then clicks away again and refocuses on the input element, the autocomplete panel will display with the new options but will now be stuck open even if the user clicks away from the element.

What are the steps to reproduce?

Using the plunker example below:

  1. Click on the input element
  2. Enter a query that should display no results (ex: "alx")
  3. Click away from the input element
  4. Click on the input element
  5. Delete characters from the query until options should display (options won't display) (ex: "al")

One way:
6. Click away from the input element
7. Click on the input element (panel will now be stuck open)

Alternatively:
6. Delete another character from the query (options will now be shown but panel is stuck open) (ex: "a")

http://plnkr.co/edit/iCCPRa73JtY44xjB9QAQ is just the demo from the material.angular.io page on the material2 plunker template

What is the use-case or motivation for changing an existing behavior?

Improve user experience

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Reproduced using the material2 template plunker with the demo from the material.angular.io demo page.

Is there anything else we should know?

Behavior may be revealed by change #5446 since removing the panelOpen check seems to fix this issue (but may itself cause other issues such as the one this change was fixing).

@crisbeto crisbeto self-assigned this Jul 20, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 20, 2017
…alue

This fixes a regression caused by the changes from 880e6d5 which prevented the panel from closing and reopening in certain cases.

Fixes angular#5910.
@BaimosTechnologies
Copy link

Hehe, we worked in parallel today, here is what I found:
Release with bug identified as: 2.0.0-beta.8-1f97945
Previous working release is: 2.0.0-beta.8-d716b00

Here my own plunk showing the same problem
https://plnkr.co/edit/OUV0hHu24XD7QwThcmqF?p=preview

crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 20, 2017
This fixes a regression caused by the changes from 880e6d5 which prevented the panel from closing and reopening in certain cases.

Fixes angular#5910.
andrewseguin pushed a commit that referenced this issue Jul 24, 2017
This fixes a regression caused by the changes from 880e6d5 which prevented the panel from closing and reopening in certain cases.

Fixes #5910.
andrewseguin pushed a commit that referenced this issue Jul 25, 2017
This fixes a regression caused by the changes from 880e6d5 which prevented the panel from closing and reopening in certain cases.

Fixes #5910.
andrewseguin pushed a commit that referenced this issue Jul 25, 2017
…5911)

This fixes a regression caused by the changes from 880e6d5 which prevented the panel from closing and reopening in certain cases.

Fixes #5910.
@BaimosTechnologies
Copy link

It works! Thanks.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants