slate icon indicating copy to clipboard operation
slate copied to clipboard

When I use stale read again, I have a problem ([Slate] value is invalid! Expected a list of elementsbut got: undefined)

Open KawhiWei opened this issue 2 years ago • 2 comments

Description When I use stale read again, I have a problem ([Slate] value is invalid! Expected a list of elementsbut got: undefined) image

Recording If the Slate component and Editable are placed in the Form.Item tag of antdesign, this problem will occur. How can I solve it? The Slate version is 0.82.1, the slate read version is 0.83.0, and the ant design version is 4.10.2 image

KawhiWei avatar Sep 22 '22 03:09 KawhiWei

I have the same problem using slate with ant.design Form Item.

Adding an hidden input n Form.Item fixed my problem though.

    <Form.Item
      name="ug_description"
      label={i18n.t("common.mobile")}
      initialValue={data?.data?.ug_description}
    >
      <Slate editor={editor} value={initialValue}>
        <Editable />
      </Slate>
      <Input hidden />
    </Form.Item>

boyaq avatar Sep 22 '22 17:09 boyaq

https://stackblitz.com/edit/github-kgekdm

https://docs.slatejs.org/concepts/02-nodes

you need children property in editor value

paulho1973 avatar Feb 28 '23 01:02 paulho1973