From 93abb4b74bc5a5aaaf06bb6e10f43ad538bbe534 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 20 Jul 2018 15:06:27 +0100 Subject: [PATCH] workaround to prevent Slate getting too empty when undoing RT pastes Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MessageComposerInput.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index a6ed136cd5..c117bce6a2 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -983,8 +983,9 @@ export default class MessageComposerInput extends React.Component { // that we will silently discard nested blocks (e.g. nested lists) :( const fragment = this.html.deserialize(transfer.html); return change - .setOperationFlag("skip", false) - .setOperationFlag("merge", false) + // XXX: this somehow makes Slate barf on undo and get too empty and break entirely + // .setOperationFlag("skip", false) + // .setOperationFlag("merge", false) .insertFragment(fragment.document); } else { // in MD mode we don't want the rich content pasted as the magic was annoying people so paste plain