Cancelling a merge request edit does not reset the autosaver
Summary
If you have changed the description in the merge request, the changed description will still appear if you visit the page again after clicking "Cancel". It doesn't "forget" your autosaved changes.
Steps to reproduce
- Create a merge request
- Click "Edit" on the merge request
- Change the description
- Click "Cancel"
- Click "Edit" on the merge request
- See that your edited description is still present
What is the current bug behavior?
The edited merge request description is autosaved after hitting the Cancel button.
What is the expected correct behavior?
The edited merge request description is cleared from being autosaved after hitting the Cancel button.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com
Possible fixes
When !57172 (merged) was introduced, it removed the .btn-cancel
class from the "Cancel" button.
Unfortunately issuable_form.js
relies on .btn-cancel
to reset the autosave.
On an MR I inspect the Cancel button, add .btn-cancel
to it, then click it, it resets the autosave as expected.