Skip to content

Autocomplete with OnPush does not open panel properly #3955

@willshowell

Description

@willshowell

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions