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