@tiptap/core 2.0.2 → 2.1.0-rc.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.cjs CHANGED
@@ -3079,7 +3079,12 @@ const Keymap = Extension.create({
3079
3079
  const { selection, doc } = tr;
3080
3080
  const { empty, $anchor } = selection;
3081
3081
  const { pos, parent } = $anchor;
3082
- const isAtStart = state.Selection.atStart(doc).from === pos;
3082
+ const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor;
3083
+ const parentIsIsolating = $parentPos.parent.type.spec.isolating;
3084
+ const parentPos = $anchor.pos - $anchor.parentOffset;
3085
+ const isAtStart = (parentIsIsolating && $parentPos.parent.childCount === 1)
3086
+ ? parentPos === $anchor.pos
3087
+ : state.Selection.atStart(doc).from === pos;
3083
3088
  if (!empty || !isAtStart || !parent.type.isTextblock || parent.textContent.length) {
3084
3089
  return false;
3085
3090
  }