UNPKG

@tiptap/core

Version:

headless rich text editor

12 lines (8 loc) 247 B
import type { EditorState } from '@tiptap/pm/state' export const isAtStartOfNode = (state: EditorState) => { const { $from, $to } = state.selection if ($from.parentOffset > 0 || $from.pos !== $to.pos) { return false } return true }