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

When passing something that is not an array, the library silently fails. #131

Closed
bobylito opened this issue Nov 21, 2016 · 2 comments
Closed

Comments

@bobylito
Copy link
Contributor

Bug report

What is the current behavior?

Currently, if the source function does not provide the expected type of suggestions to display, it fails without an error or a message.

You can see this behaviour in this fiddle.

What is the expected behavior?

I would expect to have an error or a message so that I can understand the current problem.

@cdtinney
Copy link
Contributor

cdtinney commented Sep 20, 2018

+1. It would be nice to be able to display an error message within the dropdown for queries that fail.

@Haroenv
Copy link
Contributor

Haroenv commented Sep 21, 2018

I think to fix that, we need to throw an error in an else after this, but I didn't try it out yet 😄

https://github.com/algolia/autocomplete.js/blob/3dcaced9cb4d5c763c64dc6de203abe5d874d238/src/autocomplete/dataset.js#L98-L111

cdtinney pushed a commit to cdtinney/autocomplete.js that referenced this issue Oct 9, 2018
Haroenv pushed a commit that referenced this issue Oct 15, 2018
* Throw err on update if suggestions are invalid type

Resolves #131

* Check error type and message in spec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants