Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix quote post slate update #2206

Merged
merged 2 commits into from
Oct 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/views/rooms/MessageComposerInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,12 @@ 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 {
let fragmentChange = fragment.change();
fragmentChange.moveToRangeOf(fragment.document)
fragmentChange.moveToRangeOfNode(fragment.document)
.wrapBlock(quote);

// FIXME: handle pills and use commonmark rather than md-serialize
Expand Down Expand Up @@ -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();
}
}
Expand Down Expand Up @@ -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.
Expand Down