Skip to content

Commit

Permalink
Fix a crash when lifting nested list
Browse files Browse the repository at this point in the history
FIX: Fix a regression where lifting a nested list could crash.

Closes ProseMirror/prosemirror#1299
  • Loading branch information
ocavue authored Jul 20, 2022
1 parent 757e45b commit df12c7d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/schema-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ function liftToOuterList(state: EditorState, dispatch: (tr: Transaction) => void
new Slice(Fragment.from(itemType.create(null, range.parent.copy())), 1, 0), 1, true))
range = new NodeRange(tr.doc.resolve(range.$from.pos), tr.doc.resolve(endOfList), range.depth)
}
dispatch(tr.lift(range, liftTarget(range)!).scrollIntoView())
const target = liftTarget(range)
if (target == null) return false
dispatch(tr.lift(range, target).scrollIntoView())
return true
}

Expand Down

0 comments on commit df12c7d

Please sign in to comment.