Skip to content

Commit

Permalink
check if (pos - 1) >= 0 before resolving in handleBackspace keymap he…
Browse files Browse the repository at this point in the history
…lper (#4835)

Co-authored-by: bdbch <6538827+bdbch@users.noreply.github.com>
  • Loading branch information
solastley and bdbch authored Apr 5, 2024
1 parent d6c71a8 commit 1439a91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/extensions/keymap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const Keymap = Extension.create({
const { selection, doc } = tr
const { empty, $anchor } = selection
const { pos, parent } = $anchor
const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor
const $parentPos = $anchor.parent.isTextblock && pos > 0 ? tr.doc.resolve(pos - 1) : $anchor
const parentIsIsolating = $parentPos.parent.type.spec.isolating

const parentPos = $anchor.pos - $anchor.parentOffset
Expand Down

0 comments on commit 1439a91

Please sign in to comment.