mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-21 15:28:09 +08:00
12 lines
261 B
TypeScript
12 lines
261 B
TypeScript
|
import { EditorState } from '@tiptap/pm/state'
|
||
|
|
||
|
export const istAtEndOfNode = (state: EditorState) => {
|
||
|
const { $from, $to } = state.selection
|
||
|
|
||
|
if ($to.parentOffset < $to.parent.nodeSize - 2 || $from.pos !== $to.pos) {
|
||
|
return false
|
||
|
}
|
||
|
|
||
|
return true
|
||
|
}
|