Skip to content

Replies

0
Carlos
Carlos answered on Dec 17, 2015 2:44 PM

Hi,

I have found a more or less decent implementation for it. Here's what I have so far.

function initializeWebDropDowns() {

if (e.keyCode === 38 || e.keyCode === 40) {
var instance = $IG.WebDropDown.find($(e.target).parents(".igdd_ClaymationControl")[0].id);
var currentItemIndex = instance.get_selectedItemIndex();
var numberOfItems = instance.get_items().getLength();
var newPosition;
if (e.keyCode === 38) {
newPosition = currentItemIndex === 0 ? 0 : currentItemIndex – 1;
instance.selectItemByIndex(newPosition, true, true);
return false;
}
if (e.keyCode === 40) {
newPosition = currentItemIndex === numberOfItems – 1 ? numberOfItems – 1 : currentItemIndex + 1;
instance.selectItemByIndex(newPosition, true, true);
return false;
}
}
return true;
});
}

However, this way the SelectionChanged and SelectionChanging events are not triggered anymore.

Is there a way to trigger them programatically after changing the selected item?

I also think you should review some of these "default behaviours". This is not really what most people would expect as default from a dropdown and it shouldn't be so tricky to achieve for us developers.