Commit 896b9c1d authored by Phil Hughes's avatar Phil Hughes

Fixed issue with filtering & pressing enter key

parent 5d7b2bd4
...@@ -311,6 +311,7 @@ class GitLabDropdown ...@@ -311,6 +311,7 @@ class GitLabDropdown
return true return true
opened: => opened: =>
currentIndex = -1
@addArrowKeyEvent() @addArrowKeyEvent()
if @options.setIndeterminateIds if @options.setIndeterminateIds
...@@ -568,9 +569,6 @@ class GitLabDropdown ...@@ -568,9 +569,6 @@ class GitLabDropdown
PREV_INDEX = currentIndex PREV_INDEX = currentIndex
$listItems = $(selector, @dropdown) $listItems = $(selector, @dropdown)
# if @options.filterable
# $input.blur()
if currentKeyCode is 40 if currentKeyCode is 40
# Move down # Move down
currentIndex += 1 if currentIndex < ($listItems.length - 1) currentIndex += 1 if currentIndex < ($listItems.length - 1)
...@@ -583,7 +581,7 @@ class GitLabDropdown ...@@ -583,7 +581,7 @@ class GitLabDropdown
return false return false
if currentKeyCode is 13 and currentIndex isnt -1 if currentKeyCode is 13 and currentIndex isnt -1
@selectRowAtIndex e, currentIndex @selectRowAtIndex e, $('.is-focused', @dropdown).closest('li').index() - 1
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