autoComplete.js
autoComplete.js copied to clipboard
hotfix for select(index)
Fix #356
@TarekRaafat please review this when you'll have time, thanks❤️
Any news on this bug?
I guess the reason why this TypeError: Cannot set properties of undefined (setting 'event') is fired is because select(index) is called when function init (ctx) is not yet complete.
I have fixed in my case by placing select(index) in the results event which seems to run after init is finished.
Before I tried to call select(index) on window.load and other events but in vain. Also in init event the same error was generated. I guess that even if the init event is fired, the init promise may still be not returned.