Text of unsaved comment on file of merge request is removed after scrolling
Summary
When placing or editing a comment on a file (rather than a line) in a merge request, the any unsaved changes will be lost after scrolling sufficiently far.
Steps to reproduce
- Open a (large-ish) MR, e.g. this one
- Place a comment on the first file, do not save the comment, leave the text box open, ready to add some more text.
- Scroll down sufficiently far to trigger the page to load files further down the page. (Scrolling to the file
clickhouse-operator/controllers/ca_certificate.go
was sufficient for me). - Scroll back up to the first file.
Result: Empty text box for a comment on the first file is available
Expected: Text box of comment on the first file contains text I previously entered
- Open a (large-ish) MR, e.g. this one
- Place a comment on the first file (choose "add to review", not publishing the comment).
- Click to edit the comment, and change some text, do not save the changes, leave the text box ready for further additions.
- Scroll down sufficiently far to trigger the page to load files further down the page. (Scrolling to the file
clickhouse-operator/controllers/ca_certificate.go
was sufficient for me). - Scroll back up to the first file.
Result: Original (pending) comment is visible
Expected: Editing text box with new text is available for the comment.
Example Project
What is the current bug behavior?
Any text entered in the text box is lost. When editing a (pending) comment, the editing view is closed and the original comment is visible. When adding a new comment, the editing view is open but the text box is empty.
What is the expected correct behavior?
Scrolling down and back up does not alter the state of the edit/add comment interface: the text in the text box remains. This works as expected when scrolling a small distance.
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`)
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)