@tiptap/core 2.23.1 → 2.24.1

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.js CHANGED
@@ -1637,7 +1637,7 @@ const cut = (originRange, targetPos) => ({ editor, tr }) => {
1637
1637
  tr.deleteRange(originRange.from, originRange.to);
1638
1638
  const newPos = tr.mapping.map(targetPos);
1639
1639
  tr.insert(newPos, contentSlice.content);
1640
- tr.setSelection(new TextSelection(tr.doc.resolve(newPos - 1)));
1640
+ tr.setSelection(new TextSelection(tr.doc.resolve(Math.max(newPos - 1, 0))));
1641
1641
  return true;
1642
1642
  };
1643
1643