diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-05-21 03:11:18 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz@gitlab.com> | 2016-05-21 03:11:18 +0300 |
commit | 98b1daf32df2bc811328da18e20719a12c471f1f (patch) | |
tree | afeaf0ece13a43fa9f9bcd650f4cb3571c1d71d0 /app | |
parent | 9aab0f097302a0011130002633fd651d4aa39b94 (diff) | |
parent | 9f60a2eda24c9017c8b23ae8885ca31d59fbc659 (diff) |
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
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js.coffee | 2 |
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 8cb31b2dbd7..b3f1dc969b8 100644 --- a/app/assets/javascripts/gl_dropdown.js.coffee +++ b/app/assets/javascripts/gl_dropdown.js.coffee @@ -512,7 +512,7 @@ class GitLabDropdown return false if currentKeyCode is 13 - @selectRowAtIndex currentIndex + @selectRowAtIndex if currentIndex < 0 then 0 else currentIndex removeArrayKeyEvent: -> $('body').off 'keydown' |