Commit 9f60a2ed authored by Phil Hughes's avatar Phil Hughes

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

Closes #17630
parent f26389a0
...@@ -460,7 +460,7 @@ class GitLabDropdown ...@@ -460,7 +460,7 @@ class GitLabDropdown
return false return false
if currentKeyCode is 13 if currentKeyCode is 13
@selectRowAtIndex currentIndex @selectRowAtIndex if currentIndex < 0 then 0 else currentIndex
removeArrayKeyEvent: -> removeArrayKeyEvent: ->
$('body').off 'keydown' $('body').off 'keydown'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment