This bug is triggered by typing a word and hitting enter before the AJAX request returns (depends on internet connection speed).
This fixes the TypeError raised when the results list is still undefined. this.results isn't initialised with a default value. When an enter key is hit within a search box, it triggers the select method (even if there are no results to select). When select references this.results, it's still undefined.
This bug is triggered by typing a word and hitting enter before the AJAX request returns (depends on internet connection speed).
This fixes the TypeError raised when the results list is still undefined.
this.results
isn't initialised with a default value. When an enter key is hit within a search box, it triggers theselect
method (even if there are no results to select). Whenselect
referencesthis.results
, it's still undefined.