summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-05-19 12:33:08 +0100
committerPhil Hughes <me@iamphill.com>2016-05-20 08:50:42 +0100
commit9f60a2eda24c9017c8b23ae8885ca31d59fbc659 (patch)
tree0975989ff55d979dcb322b059b551407bf7c65d2
parentf26389a02a48a53cccb3bb7dd1d7bcd4858c118d (diff)
downloadgitlab-ce-dropdown-enter-select.tar.gz
Fixed issue with enter key selecting wrong option in dropdowndropdown-enter-select
If you search for a label and press enter the dropdown will select the last element rather than the first. This is because the currentIndex is -1 rather than 0 Closes #17630
-rw-r--r--app/assets/javascripts/gl_dropdown.js.coffee2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee
index 1d1bfeb2e77..fd97471cdc4 100644
--- a/app/assets/javascripts/gl_dropdown.js.coffee
+++ b/app/assets/javascripts/gl_dropdown.js.coffee
@@ -460,7 +460,7 @@ class GitLabDropdown
return false
if currentKeyCode is 13
- @selectRowAtIndex currentIndex
+ @selectRowAtIndex if currentIndex < 0 then 0 else currentIndex
removeArrayKeyEvent: ->
$('body').off 'keydown'