From a96a57dd81800d1d03fd76d353f66755893184f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20K=C3=BChn?= Date: Fri, 3 Dec 2021 10:40:56 +0100 Subject: [PATCH] code style --- .../core/src/helpers/resolveFocusPosition.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) 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