diff --git a/docs/src/demos/Experiments/Figure/figure.ts b/docs/src/demos/Experiments/Figure/figure.ts index 828a9f3c..f6f971db 100644 --- a/docs/src/demos/Experiments/Figure/figure.ts +++ b/docs/src/demos/Experiments/Figure/figure.ts @@ -105,7 +105,10 @@ export const Figure = Node.create({ }) // set cursor at end of caption field .command(({ tr, commands }) => { - return commands.setTextSelection(tr.doc.resolve(tr.selection.to - 2).end()) + const { doc, selection } = tr + const position = doc.resolve(selection.to - 2).end() + + return commands.setTextSelection(position) }) .run() },