Skip to content

Error: Cannot resolve a DOM point from Slate point: {"path":[0,0],"offset":8} #912

Answered by ghingis
sepsol asked this question in Q&A
Discussion options

You must be logged in to vote

It's not a bug and it is not from plate either, this is how slate intended to work.
(If you change the content of the editor without using the Transforms API, you have to manage the selection too)

Try, to deselect the editor, before you clear it

import { Transforms } from "slate";
import { useStoreEditorState, useEventEditorId, Plate } from "@udecode/plate";
// ...
const editor = useStoreEditorState(useEventEditorId("focus"));
// ...
Transforms.deselect(editor);
setValue(INITIAL_VALUE);

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sepsol
Comment options

Answer selected by sepsol
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #910 on August 06, 2021 11:09.