From 4d1f2cdfa9c3a7028264de40bbbc1829fc77ee58 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 11 Oct 2018 10:29:55 +0100 Subject: [PATCH 1/2] Fix quote post slate update Missed API update --- src/components/views/rooms/MessageComposerInput.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 640b1b85f3..506962ba1e 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -428,7 +428,7 @@ export default class MessageComposerInput extends React.Component { this.onChange(change); } else { let fragmentChange = fragment.change(); - fragmentChange.moveToRangeOf(fragment.document) + fragmentChange.moveToRangeOfNode(fragment.document) .wrapBlock(quote); // FIXME: handle pills and use commonmark rather than md-serialize From 3efc09586bd69f4e7f1d357c6d372ea700b66906 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 11 Oct 2018 10:47:36 +0100 Subject: [PATCH 2/2] More API changes --- src/components/views/rooms/MessageComposerInput.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 506962ba1e..09f8d8f6e8 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -423,7 +423,7 @@ export default class MessageComposerInput extends React.Component { focus: { key: quote.key, }, - })).collapseToEndOfBlock().insertBlock(Block.create(DEFAULT_NODE)).focus(); + })).moveToEndOfBlock().insertBlock(Block.create(DEFAULT_NODE)).focus(); this.onChange(change); } else { @@ -838,7 +838,7 @@ export default class MessageComposerInput extends React.Component { parent.object !== 'document') { return change.replaceNodeByKey(editorState.anchorBlock.key, editorState.anchorText) - .collapseToEndOf(parent) + .moveToEndOfNode(parent) .focus(); } } @@ -1293,7 +1293,7 @@ export default class MessageComposerInput extends React.Component { } // Move selection to the end of the selected history - const change = editorState.change().collapseToEndOf(editorState.document); + const change = editorState.change().moveToEndOfNode(editorState.document); // We don't call this.onChange(change) now, as fixups on stuff like emoji // should already have been done and persisted in the history.