Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrennan Roberts <brennan.r.roberts@gmail.com>2016-10-03 01:11:08 +0300
committerRémy Coutable <remy@rymai.me>2016-10-10 11:16:09 +0300
commitf3c55164d21b64de13a75a9004b48005cc7c901a (patch)
tree7e6dc46939c04285f3919537ab19f77e788e424a /app/assets/javascripts/gl_dropdown.js
parent4e963fed42ad518caa7353d361a38a1250c99c41 (diff)
Prevent conflict b/w search field and its dropdown
Stop the global search form's default "action" from fighting with dropdown items when using the keyboard to navigate the dropdown. `e.preventDefault()` is now called on the enter key when a dropdown item is already selected. Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'app/assets/javascripts/gl_dropdown.js')
-rw-r--r--app/assets/javascripts/gl_dropdown.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js
index d4403375643..e034ca68645 100644
--- a/app/assets/javascripts/gl_dropdown.js
+++ b/app/assets/javascripts/gl_dropdown.js
@@ -738,6 +738,7 @@
return false;
}
if (currentKeyCode === 13 && currentIndex !== -1) {
+ e.preventDefault();
_this.selectRowAtIndex();
}
};