@tiptap/core 2.0.1 → 2.1.0-rc.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
@@ -3073,7 +3073,12 @@
3073
3073
  const { selection, doc } = tr;
3074
3074
  const { empty, $anchor } = selection;
3075
3075
  const { pos, parent } = $anchor;
3076
- const isAtStart = state.Selection.atStart(doc).from === pos;
3076
+ const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor;
3077
+ const parentIsIsolating = $parentPos.parent.type.spec.isolating;
3078
+ const parentPos = $anchor.pos - $anchor.parentOffset;
3079
+ const isAtStart = (parentIsIsolating && $parentPos.parent.childCount === 1)
3080
+ ? parentPos === $anchor.pos
3081
+ : state.Selection.atStart(doc).from === pos;
3077
3082
  if (!empty || !isAtStart || !parent.type.isTextblock || parent.textContent.length) {
3078
3083
  return false;
3079
3084
  }