I'm trying to use a "tab" to grab the currently highlighted item in the dropdown and populate it into the the text field. However, I'm having 2 separate problems with this.
The first is that I cannot get the "tab" key's default action to stop from firing. I have tried capturing the keydown even from my MultiSelect box's input field using the following code:
Using this code, the focus is still moved from the input to the next item on the page and is not giving me the desired functionality of doing nothing when tab is pressed.
My next problem is the fact that I cannot find how kendo determines which item in the list of filtered items is highlighted. I don't see any properties being set when you use the arrow keys to highlight the input you want from that list. I would like to get the displayed text inside that highlighted item and populate it into the text input area when I press tab. Currently I cannot figure out how to figure out how to get the item without selecting it with a click or hitting enter while it is highlighted.
Help with either or both of these would be extremely appreciated.
The first is that I cannot get the "tab" key's default action to stop from firing. I have tried capturing the keydown even from my MultiSelect box's input field using the following code:
$(
"#myInput"
).data().kendoMultiSelect.input.on(
"keydown"
,
function
(event) {
var
code = event.keyCode;
if
(code == 9) {
//9 is the keyCode for Tab
event.preventDefault();
}
}
Using this code, the focus is still moved from the input to the next item on the page and is not giving me the desired functionality of doing nothing when tab is pressed.
My next problem is the fact that I cannot find how kendo determines which item in the list of filtered items is highlighted. I don't see any properties being set when you use the arrow keys to highlight the input you want from that list. I would like to get the displayed text inside that highlighted item and populate it into the text input area when I press tab. Currently I cannot figure out how to figure out how to get the item without selecting it with a click or hitting enter while it is highlighted.
Help with either or both of these would be extremely appreciated.