Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get the start point in the node at path [] because it has no start text node. #5586

Open
rockyessel opened this issue Jan 5, 2024 · 1 comment
Labels

Comments

@rockyessel
Copy link

Description
This error arises when all content is deleted, an image is uploaded with its position altered, and subsequent deletion of the modified image, followed by clicking the text editor and entering additional content, triggers another error.

Recording
https://cdn.sanity.io/files/l4h1g3vt/production/65018cbcc15a34dc990621c14cc5bce25c2dc41a.webm

Sandbox
This can be reproduced using the code from Slate Examples with images: Link.
And live at this link

Steps
To reproduce the behavior:

  1. Go to the live example provided by Slate
  2. Select all text and images, and delete them
  3. Then upload an image by copying any image URL, then pasting it into the prompt
  4. Then move/drag the image to the top-most of the editor, then delete the image when focused.
  5. Then click on the editor, then the error appears, and when you type additional error occurs.

Expectation
When an image is inserted, and moved/dragged to the top-most of the editor, when deleted, users should be able to type text successfully without any error.

Environment

  • Slate Version: ["^0.101.5"]
  • Operating System: ["Linux"]
  • Browser: ["Chrome"]
  • TypeScript Version: ["5"]
@rockyessel rockyessel added the bug label Jan 5, 2024
@ctakahob
Copy link

try replacing the node with a new one

const newNode = { type: "paragraph", children: [{ text: "" }] };

    if (isEmpty(value)) {
      Transforms.insertNodes(editor, newNode);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants