Uncaught TypeError: Cannot read property 'cap' of undefined
at MagicSuggest.eval (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:113417:26)
at MagicSuggest.dispatch (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:3:8549)
at MagicSuggest.r.handle (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:3:5252)
at Object.trigger (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:3:7650)
at Object.e.event.trigger (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:2:6732)
at MagicSuggest.eval (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:3:15517)
at Function.each (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:2:2975)
at e.fn.init.each (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:2:835)
at e.fn.init.trigger (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:3:15493)
at MagicSuggest.removeFromSelection (eval at <anonymous> (eval at <anonymous> (eval at <anonymous> (VM8367 jquery.min.js:2))), <anonymous>:1:3563)
I'm trying to programmatically select an element in a combo box powered by MagicSuggest.
The following code, the first time gives an error, the second time works as expected, the third time gives error, the fourth time works, and so on:
The error is: