Skip to content

Commit

Permalink
make small target correction
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnuttandrew committed Jul 18, 2023
1 parent cbbb47b commit 3f5fdf5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/prong-editor/src/components/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ export default function Editor(props: {
if (view && view.state.doc.toString() !== code) {
// hack :(
setTimeout(() => {
simpleUpdate(view, 0, view.state.doc.length, code);
view.dispatch(
view.state.update({
changes: { from: 0, to: view.state.doc.length, insert: code },
selection: view.state.selection,
})
);
}, 300);
}
}, [code, view]);
Expand Down

0 comments on commit 3f5fdf5

Please sign in to comment.