Issuable Templates Break Undo History
Summary
Applying a template to an issue or MR, then performing the undo operation does not produce the expected results.
Steps to reproduce
- Create a new issue
- Type a description
- Apply a template
- Undo
- Redo
What is the current bug behavior?
The template ends up in an invalid state that is not part of the history.
What is the expected correct behavior?
The description should revert to the content just before the template was applied.
Output of checks
This bug happens on GitLab.com
Possible fixes
- Use a higher level DOM API to replace the text so that the changes are properly captured in the edit history.