Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

fix(autocomplete): only handle results if it's an array or a promise #7089

Closed

Conversation

devversion
Copy link
Member

At the moment the autocomplete will handle the results wrong.
So if we specify for example an empty JSON-Object, the autocomplete will handle the results as an async promise.

Fixes #7074

At the moment the autocomplete will handle the results wrong.
So if we specify for example an empty JSON-Object, the autocomplete will handle the results as an async promise.

Fixes angular#7074
@devversion devversion added the needs: review This PR is waiting on review from the team label Mar 3, 2016
@EladBezalel
Copy link
Member

LGTM

@EladBezalel EladBezalel added pr: merge ready This PR is ready for a caretaker to review and removed needs: review This PR is waiting on review from the team labels Mar 3, 2016
if ( isList ) handleResults(items);
else handleAsyncResults(items);
if (isList) handleResults(items);
else if (isPromise) handleAsyncResults(items);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Messing scenario: what if not a list and not a Promise?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about doing nothing, because it makes no sense, and otherwise it will prevent the autocomplete from working. See the demo of the actual issue. http://codepen.io/anon/pen/Gowjmv?editors=1010

ThomasBurleson pushed a commit that referenced this pull request Apr 1, 2016
At the moment the autocomplete will handle the results wrong.
So if we specify for example an empty JSON-Object, the autocomplete will handle the results as an async promise.

Fixes #7074

Closes #7089

# Conflicts:
#	src/components/autocomplete/autocomplete.spec.js
ThomasBurleson pushed a commit that referenced this pull request Apr 1, 2016
At the moment the autocomplete will handle the results wrong.
So if we specify for example an empty JSON-Object, the autocomplete will handle the results as an async promise.

Fixes #7074

Closes #7089

# Conflicts:
#	src/components/autocomplete/autocomplete.spec.js
gmoothart pushed a commit to gmoothart/material that referenced this pull request Apr 5, 2016
At the moment the autocomplete will handle the results wrong.
So if we specify for example an empty JSON-Object, the autocomplete will handle the results as an async promise.

Fixes angular#7074

Closes angular#7089
@devversion devversion deleted the fix/autocomplete-check-promise branch April 19, 2016 19:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pr: merge ready This PR is ready for a caretaker to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants