autoComplete.js icon indicating copy to clipboard operation
autoComplete.js copied to clipboard

hotfix for select(index)

Open maksimbykov opened this issue 2 years ago • 3 comments

Fix #356

maksimbykov avatar Aug 31 '22 18:08 maksimbykov

@TarekRaafat please review this when you'll have time, thanks❤️

maksimbykov avatar Aug 31 '22 18:08 maksimbykov

Any news on this bug?

AndrewElans avatar Apr 28 '23 14:04 AndrewElans

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.

AndrewElans avatar Apr 28 '23 22:04 AndrewElans