diff options
author | Brennan Roberts <brennan.r.roberts@gmail.com> | 2016-10-03 01:11:08 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-10 11:16:09 +0300 |
commit | f3c55164d21b64de13a75a9004b48005cc7c901a (patch) | |
tree | 7e6dc46939c04285f3919537ab19f77e788e424a /app/assets/javascripts/gl_dropdown.js | |
parent | 4e963fed42ad518caa7353d361a38a1250c99c41 (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.js | 1 |
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(); } }; |