mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 17:43:49 +08:00
code style
This commit is contained in:
parent
b4ab7f079b
commit
a96a57dd81
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user