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 with OnPush does not open panel properly #3955

Closed
willshowell opened this issue Apr 7, 2017 · 1 comment · Fixed by #3977
Closed

Autocomplete with OnPush does not open panel properly #3955

willshowell opened this issue Apr 7, 2017 · 1 comment · Fixed by #3977
Assignees

Comments

@willshowell
Copy link
Contributor

Bug, feature request, or proposal:

Bug

What is the expected behavior?

If the autocomplete's md-options length changes from 0 to n due to options arriving asynchronously, the panel should display even with OnPush.

What is the current behavior?

The panel does not show itself until the user types or refocuses the input.

What are the steps to reproduce?

http://plnkr.co/edit/fWoO47LDbCZFJ9i887jU?p=preview

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

My options are the result of an ajax request. When they arrive, I want filteredOptions to be recalculated and the autocomplete to reflect it. filteredOptions are recalculated, but the autocomplete panel doesn't show itself.

Other information

If filteredOptions uses .startWith(x) where x.length > 0, it works as expected. It only fails if the initial value is an empty array.

@crisbeto crisbeto self-assigned this Apr 8, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 8, 2017
… detection

Fixes an issue that prevented the autocomplete panel from being shown if the options are initialized with a delay in a component that has `OnPush` change detection.

Fixes angular#3955.
@crisbeto crisbeto added the has pr label Apr 8, 2017
kara pushed a commit that referenced this issue Apr 18, 2017
@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 5, 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.

2 participants