Fix reply quote keyboard shortcut on MRs
What does this MR do?
Fix reply quote keyboard shortcut on MRs,
- Moves the
ShortcutsIssuableinitialization after the
.js-main-target-form #note_notetextarea has been setup. We now cache the selector on initialization (introduced in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14783)
Are there points in the code the reviewer needs to double check?
Why was this MR needed?
Selecting text and pressing
r wouldn't add anything to the textarea (would throw an error)
Uncaught TypeError: Cannot read property 'trim' of undefined at ShortcutsIssuable.replyWithSelectedText
It seems like this regressed in https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/14783/diffs#96c8603e2992a1004acce9fc17ed71ecd40f740f_39_12 where we now cache the reply field once at the beginning instead of when the method is actually called.
Does this MR meet the acceptance criteria?
Changelog entry added, if necessary
- Tests added for this feature/bug
- Has been reviewed by Frontend
- Conform by the merge request performance guides
- Conform by the style guides
- Squashed related commits together
- Internationalization required/considered
What are the relevant issue numbers?
Closes #40295 (closed)