🐛 Fixed pasted image files appearing twice in editor

closes https://github.com/TryGhost/Team/issues/1254

- when switching over to a more generic file paste handling the prevention of the default paste behaviour was missed meaning an additional image element was added to the contenteditable area which was not rendered on the front-end and disappeared when reloading the post
This commit is contained in:
Kevin Ansfield 2021-12-07 18:07:46 +00:00
parent 18535571b6
commit a54c4d28be
1 changed files with 3 additions and 0 deletions

View File

@ -966,6 +966,9 @@ export default Component.extend({
editor.run((postEditor) => {
insertCardsFromFiles(event.clipboardData.files, postEditor);
});
// prevent mobiledoc's default paste event handler firing
event.preventDefault();
event.stopImmediatePropagation();
return;
}