[Dropdown] shouldn’t be firing onChange during the keyboard navigation
See original GitHub issueHi,
I have a drop down element (“ui fluid search selection dropdown large elemento_area”) in my page and if the user hits the letter “C” (for example) the dropdown shows a list of possible results that the user can choose. Ok, it works fine and it’s really great. When the user selects some option I use the code below to do my stuff:
$(".elemento_area").dropdown({
action:"hide",
onChange:function(value,text,$selectedItem) {
window.location.href = "index.php?area=" + value;
}
});
Ok, it works fine too. The problem is that if the user types “C” and press one of the arrows of the keyboard (down/up) to navigate thgouth the options, as soon as the user presses down key, the event ONCHANGE is fired. This shouldnt happen cause the user still didnt decided what option he wants to choose, he is just using the arrow keys to navigate till the desired option (think about a lazey person or a handcapted).
I think there should be an event that fires only when user selects indeed the option he wants like “onselect”. And I think the behaviour of “onchange” should make it’s name change to “onnavigate”…
Am I doing something wrong and this “onselect” event already exists? In the docs I couldnt find anything about this, only a handful of events.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:6 (3 by maintainers)
Top GitHub Comments
WORKED PERFECTLY!!! I was waiting since February for this solution! This website https://www.deobraemobra.com.br relies heavily in semantic ui and I had to use a terrible hack in the search box at the top! Now I can easily press KEY DOWN in my keyboard to navigate inside the options and the onchange event does not fire.
@Banandrew great help of yours, again you surprised me with good news 😉 This webiste is working perfectly now, I just removed the hack and it was pretty forward to make it work, just added “selectOnKeydown:false” and it worked!
I’ve just stumbled upon this thread and realized that I mislabeled it—
selectOnKeydown
property does exactly that.