@tiptap/core 2.23.0 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1639,7 +1639,7 @@ const cut = (originRange, targetPos) => ({ editor, tr }) => {
1639
1639
  tr.deleteRange(originRange.from, originRange.to);
1640
1640
  const newPos = tr.mapping.map(targetPos);
1641
1641
  tr.insert(newPos, contentSlice.content);
1642
- tr.setSelection(new state.TextSelection(tr.doc.resolve(newPos - 1)));
1642
+ tr.setSelection(new state.TextSelection(tr.doc.resolve(Math.max(newPos - 1, 0))));
1643
1643
  return true;
1644
1644
  };
1645
1645