Fix delete text on attach file toolbar button
What does this MR do and why?
This MR fixes an assumption made in an insertText
helper function. We shouldn't run document.execCommand('delete')
is we don't have a selection.
This fixes a bug where a character is removed when the attach-file
button is pressed.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Before | After |
---|---|
bug_attach_file_delete | fix_attach_file_delete |
How to set up and validate locally
This bug is also being fixed as a side-effect of Add guard clause to insertMarkdownText (!145027 - merged). If that MR isn't merged yet, you can validate this MR by:
- Start GDK
- Go to an Issue or Merge Request
- Write a new comment with
ABCDEF
and click theattach-file
toolbar button. Cancel the file dialog. The comment text should not change.
Otherwise, this MR is still good to go, but there might not be any user-facing changes.
Thanks
Thanks to @leipert and @john-slaughter for pairing with me here
Edited by Paul Slaughter