Reputation: 41
I am trying to shift focus from a Kendo UI AutoComplete to an input element after an item has been selected. I've tried this...
select: function (e) {
e.preventDefault();
var dataItem = this.dataItem(e.item.index());
vm.selectedProductID(dataItem.ProdID);
$('#itemQtyBox').focus();
}
But it didn't work.
Upvotes: 1
Views: 2664
Reputation: 40887
Seems that you cannot change focus from inside select
handler... maybe it's acceptable for you wait a little and then do it. I mean:
select : function (e) {
setTimeout(function () {
$("#itemQtyBox").focus();
}, 100);
}
What I do is set a timeout (in the previous example 0.1 seconds) and then change focus (I know that it is not nice but works).
Upvotes: 1