diff --git a/app/assets/javascripts/gl_dropdown.js b/app/assets/javascripts/gl_dropdown.js index 3babe273100..9475498e176 100644 --- a/app/assets/javascripts/gl_dropdown.js +++ b/app/assets/javascripts/gl_dropdown.js @@ -730,10 +730,10 @@ GitLabDropdown = (function() { GitLabDropdown.prototype.focusTextInput = function(triggerFocus = false) { if (this.options.filterable) { - $(':focus').blur(); - this.dropdown.one('transitionend', () => { - this.filterInput.focus(); + if (this.dropdown.is('.open')) { + this.filterInput.focus(); + } }); if (triggerFocus) { diff --git a/changelogs/unreleased/search-flickering.yml b/changelogs/unreleased/search-flickering.yml new file mode 100644 index 00000000000..951a5a0292a --- /dev/null +++ b/changelogs/unreleased/search-flickering.yml @@ -0,0 +1,4 @@ +--- +title: Fix search box losing focus when typing +merge_request: +author: