1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-02-01 05:16:10 +01:00

Fix newText condition (#1838)

This commit is contained in:
Nicolas Gaborit 2018-07-05 17:43:17 +02:00 committed by Ian Storm Taylor
parent 57138de130
commit ec2b17c2d6

View File

@ -171,7 +171,7 @@ Changes.insertFragment = (change, fragment) => {
const newTexts = document.getTexts().filter(n => !keys.includes(n.key))
const newText = isAppending ? newTexts.last() : newTexts.takeLast(2).first()
if ((newText && lastInline) || isInserting) {
if (newText && (lastInline || isInserting)) {
change.select(selection.collapseToEndOf(newText))
} else if (newText) {
change.select(