fix: revert changes to selectAll command, fix #2491

This commit is contained in:
Philipp Kühn
2022-02-07 10:19:46 +01:00
parent 7f97efb7cd
commit bdab760cdb
2 changed files with 19 additions and 11 deletions

View File

@@ -20,7 +20,7 @@ export const setTextSelection: RawCommands['setTextSelection'] = position => ({
? { from: position, to: position }
: position
const minPos = TextSelection.atStart(doc).from
const maxPos = doc.content.size
const maxPos = TextSelection.atEnd(doc).to
const resolvedFrom = minMax(from, minPos, maxPos)
const resolvedEnd = minMax(to, minPos, maxPos)
const selection = TextSelection.create(doc, resolvedFrom, resolvedEnd)