summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/assets/javascripts/gl_dropdown.js.coffee8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js.coffee b/app/assets/javascripts/gl_dropdown.js.coffee
index f0cad37d9e3..00d89a8257a 100644
--- a/app/assets/javascripts/gl_dropdown.js.coffee
+++ b/app/assets/javascripts/gl_dropdown.js.coffee
@@ -565,11 +565,13 @@ class GitLabDropdown
if $el.length and currentIndex > -1
e.preventDefault()
e.stopImmediatePropagation()
+ $first = $el.first()
+ $firstEl = $first.get(0)
- if $el.first().get(0).click
- $el.first().get(0).click()
+ if $firstEl.click
+ $firstEl.click()
else
- $el.first().trigger('click')
+ $first.trigger('click')
addArrowKeyEvent: ->
ARROW_KEY_CODES = [38, 40]