Markdown Editor autocomplete dropdown keyboard navigation is broken
Summary
Using the keyboard to navigate through the Markdown editor's autocomplete dropdown doesn't work.
It does move the highlighted element, but that's usually reset to the first item far too fast for the movement to be useful.
Steps to reproduce
Tested with Firefox 124 on GitLab & GitLab Next on 2024-04-01 on Ubuntu 22.04.
- Visit an MR or an Issue
- Type
@s
or any other combination that will open the autocomplete dropdown with at least 2-3 items.- This works in the comment field or when editing the description
- Use the arrow keys to navigate up (to the bottom of the list) or down (to the second item)
- Note how it resets the highlighted element.
- If you navigate up to get to the bottom, and the bottom is some amount of scrolling away from the top, the highlight will reset to the top, but the scroll will remain at the bottom.
Example Project
https://gitlab.com/gitlab-org/gitlab
What is the current bug behavior?
- The dropdown autocomplete item highlight does not allow keyboard navigation to move the highlight.
What is the expected correct behavior?
- The dropdown autocomplete should allow the keyboard to move the highlighted item and leave the highlight there.
Relevant logs and/or screenshots
MR | Issue |
---|---|
RecApp-2024-04-01-13_56_23 | RecApp-2024-04-01-14_03_49 |
Output of checks
This bug happens on GitLab.com
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`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
-
Updating our fork of At.js to ignore 229/Process key events, and also
event.isComposing
events. See #453990 (comment 1841510170). - Reverting
9e0ca37a267478fe562aebcfeb8a30ba0b7f433e
does not resolve this issue.
Edited by Mark Florian