提交 98b1daf3 编写于 作者: J Jacob Schatz

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
......@@ -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'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册