summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-05-21 00:11:18 +0000
committerYorick Peterse <yorickpeterse@gmail.com>2016-05-25 13:02:48 +0200
commitb3179451454050c9e7103090f237cb11a2435476 (patch)
tree0ec8d7ac10996b721c408d38119e6c625aa83975
parentd5640394b53be350d4210aead9f3556d8350aff5 (diff)
downloadgitlab-ce-b3179451454050c9e7103090f237cb11a2435476.tar.gz
Merge branch 'dropdown-enter-select' into 'master'
Fixed issue with enter key selecting wrong option in dropdown 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 ![labels](/uploads/eb29924109947fd63fea32e21471f05a/labels.gif) Closes #17630 See merge request !4210
-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'