Search bar takes over up/down/enter keys even after losing focus

Summary

While typing a comment in an MR if I start searching before submitting the comment then go back to the comment I lose the ability to use up/down/enter keys in the comment input because the search bar has hijacked those key presses.

Steps to reproduce

Example video to reproduce: https://youtu.be/aRqso0xjAhc

  1. Open an MR
  2. Go to the diff tab
  3. Start adding a comment (don't submit it, but just type something in the input)
  4. Click into the search bar at the top of the page
  5. Type some search
  6. Wheel click on a search result to open it in a new tab ("wheel click" means click on the scroll wheel which is how I open a link in a new tab in the video)
  7. Go back to the comment input and type some more
  8. Try pressing up or down arrows. You'll notice they do not move you around the comment box anymore
  9. Press enter key and you'll notice it submits the search from earlier

Example Project

What is the current bug behavior?

What is the expected correct behavior?

Relevant logs and/or screenshots

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Possible fixes

Edited by Dylan Griffith