-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Cannot read property 'limit' of undefined" #124
Comments
It appears your suggestions are of the wrong format. https://github.com/darrenjennings/vue-autosuggest#props
Suggestions are arrays of section objects. Could probably use some better expected return value warnings. For instance, if Bad: ❌ return [{data: null}] // vue-autosuggest should maybe handle this for you and treat null same as []
return ['frodo', 'samwise']
return [{}] Good ✅ return [{data: []}] // empty section
return [{data: ['frodo', 'samwise']}
return [] // empty everything
return [{name: 'hobbits', data: ['frodo', 'samwise']}, {name: 'humans', data: ['aragorn']}] // with sections: https://github.com/darrenjennings/vue-autosuggest#sectionconfigs This reproduces your error: |
Leaving this open to handle null data |
Hi Darren Thank you for providing this module. I had the exact same problem as described above, until I found out by trail and error that the format was wrong. :) |
Fixed in |
vue-autosuggest
version: 2.0.0node
version: 11.10.1npm
version: 6.9.0What I did:
I try to change your demo from 'Advanced usage' section to my needs. And the demo without any modifications works fine. I want to get results via ajax and results will be stored in vuex store. So, in 'onInputChange' method I fire dispatch to action (with some delay so the dispath is not run after change of every character), and actions get data from server and send to vuex store and results are available in computed as 'suggestions' and it's connected to ':suggestions' props in 'vue-autosuggest' component. So far so good. In Dev tools in Chrome in Vue section I see after dispatch the store is updated - so results are available.
What happened:
No suggestion appears
Problem description:
After dispatch on console, I receive:
I have no idea where is the problem.
The text was updated successfully, but these errors were encountered: