diff options
author | Phil Hughes <me@iamphill.com> | 2017-07-27 17:30:57 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-03 19:03:49 +0300 |
commit | 655510ec9a658c28f50ccb0caea394f5db7cae59 (patch) | |
tree | ba7d3c35c5d906ad28f2811cfb501bbc7aa0941e /app/assets/javascripts/gl_dropdown.js | |
parent | 85582b0537c50304f30b71a0de61954b1f6c508a (diff) |
fixed haml lint
Diffstat (limited to 'app/assets/javascripts/gl_dropdown.js')
-rw-r--r-- | app/assets/javascripts/gl_dropdown.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js index 9475498e176..85d720c3a69 100644 --- a/app/assets/javascripts/gl_dropdown.js +++ b/app/assets/javascripts/gl_dropdown.js @@ -731,9 +731,15 @@ GitLabDropdown = (function() { GitLabDropdown.prototype.focusTextInput = function(triggerFocus = false) { if (this.options.filterable) { this.dropdown.one('transitionend', () => { + const initialScrollTop = $(window).scrollTop(); + if (this.dropdown.is('.open')) { this.filterInput.focus(); } + + if ($(window).scrollTop() < initialScrollTop) { + $(window).scrollTop(initialScrollTop); + } }); if (triggerFocus) { |