Skip to content
Snippets Groups Projects
Commit 896b9c1d authored by Phil Hughes's avatar Phil Hughes
Browse files

Fixed issue with filtering & pressing enter key

parent 5d7b2bd4
No related branches found
No related tags found
1 merge request!5111Fixed enter submitting form in dropdown
Pipeline #
Loading
@@ -311,6 +311,7 @@ class GitLabDropdown
Loading
@@ -311,6 +311,7 @@ class GitLabDropdown
return true return true
   
opened: => opened: =>
currentIndex = -1
@addArrowKeyEvent() @addArrowKeyEvent()
   
if @options.setIndeterminateIds if @options.setIndeterminateIds
Loading
@@ -568,9 +569,6 @@ class GitLabDropdown
Loading
@@ -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)
Loading
@@ -583,7 +581,7 @@ class GitLabDropdown
Loading
@@ -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'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment