Commit 078ba6a2 authored by Eric Eastwood's avatar Eric Eastwood

Fix issue comment submit button disabled on GFM 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
parent 52f5259a
......@@ -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');
......
---
title: Fix Issue comment submit button being disabled when pasting content from another
GFM note
merge_request: 15530
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment