Select on mouseclick and Enter only

2 posts, 0 answers
  1. Erik Gantar
    Erik Gantar avatar
    7 posts
    Member since:
    Oct 2005

    Posted 11 Nov 2015 Link to this post


    I have a problem with combobox keyboard navigation, since up and down arrow keys trigger both the change and select event of the combobox and the desired functionality is for that to happen only if the selection is made by left mouse button down or Enter key. I've tried catching the keydown event in both the change and select events of the combobox but the keycode values aren't part of the values passed by the event.

  2. Georgi Krustev
    Georgi Krustev avatar
    3725 posts

    Posted 13 Nov 2015 Link to this post

    Hello Erik,

    The ComboBox, like DropDownList widget, mimics HTML Select behavior, and namely the widget should trigger change when new value is selected while popup is closed. I am afraid that there is no easy way to prevent this behavior. The only solution I can think of is to prevent selection (call e.preventDefault in select event). You can find which key has been pressed wiring the keydown event outside of the widget:
    select: function(e) {
      if (/*condition*/) {
    });"kendoComboBox").input.on("keydown", function(e) {
      //cache the e.keyCode here

    Georgi Krustev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top