diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-11-21 15:36:15 -0600 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-11-22 22:41:39 -0600 |
commit | 3797dc692ca65ac69e0d4d51e9c71f674da2c0d7 (patch) | |
tree | d2b816178a65021788a92ffba86a77f6c6fcaaf1 /app/assets/javascripts/lib/utils/common_utils.js | |
parent | f5534059011b6752c28d7d6d7538897d6da369ae (diff) | |
download | gitlab-ce-40373-fix-issue-note-submit-disabled-on-paste.tar.gz |
Fix issue comment submit button disabled on GFM paste40373-fix-issue-note-submit-disabled-on-paste
Fix https://gitlab.com/gitlab-org/gitlab-ce/issues/40373
When copying some text from another note and paste,
it goes through `copy_as_gfm` `paste` handler
that calls `e.preventDefault()` which stops things.
But then when inserting the text, we manually trigger
an `input` event with jQuery which doesn't seem to be
picked up by Vue `v-model`.
Using copy/paste trick from https://stackoverflow.com/a/41046276/796832
Diffstat (limited to 'app/assets/javascripts/lib/utils/common_utils.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/common_utils.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/assets/javascripts/lib/utils/common_utils.js b/app/assets/javascripts/lib/utils/common_utils.js index 195e2ca6a78..116b5364fb4 100644 --- a/app/assets/javascripts/lib/utils/common_utils.js +++ b/app/assets/javascripts/lib/utils/common_utils.js @@ -190,7 +190,7 @@ export const insertText = (target, text) => { target.selectionStart = target.selectionEnd = selectionStart + insertedText.length; // Trigger autosave - $(target).trigger('input'); + target.dispatchEvent(new Event('input')); // Trigger autosize const event = document.createEvent('Event'); |