diff --git a/packages/core/src/helpers/resolveFocusPosition.ts b/packages/core/src/helpers/resolveFocusPosition.ts index 89d99ffe..4bbc8eb8 100644 --- a/packages/core/src/helpers/resolveFocusPosition.ts +++ b/packages/core/src/helpers/resolveFocusPosition.ts @@ -8,10 +8,21 @@ export default function resolveFocusPosition( position: FocusPosition = null, ): Selection | null { - if (!position) { return null } - if (position === 'start' || position === true) { return Selection.atStart(doc) } - if (position === 'end') { return Selection.atEnd(doc) } - if (position === 'all') { return TextSelection.create(doc, 0, doc.content.size) } + if (!position) { + return null + } + + if (position === 'start' || position === true) { + return Selection.atStart(doc) + } + + if (position === 'end') { + return Selection.atEnd(doc) + } + + if (position === 'all') { + return TextSelection.create(doc, 0, doc.content.size) + } // Check if `position` is in bounds of the doc if `position` is a number. const minPos = Selection.atStart(doc).from