-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Transforms.setNodes
unexpected behavior of children
#5686
Comments
children
Transforms.setNodes
unexpected behavior of children
Adding nodes should not use setNodes, but rather APIs such as insertNodes |
hi, @WindRunnerMax thanks for your reply For example, in Markdown syntax, inputting Currently, my workaround is to first use the for example,After |
@electroluxcode Changing the content using |
|
Unfortunately, that would severely increase Slate's bundle size and code complexity, and harm the predictability of its API. I don't think it's a good candidate for inclusion in core. |
Description
it refer https://docs.slatejs.org/api/transforms#transforms.setnodes-editor-editor-props-partial-less-than-node-greater-than-options
props: Partial<Node>
has a prop namedchildren
,However, when I read the source code in pathpackages\slate\src\interfaces\transforms\general.ts
, I found that the props parameter namedchildren
did not render . There's this codethis code makes it impossible for setNodes to handle nested cases with 'children'
Expectation
maybe setNodes should be able to handle nested cases with 'children'
Environment
eg
for example
this code will only render first level and missing
children
it seem deliberate in reading source,i have quesion why would do that
thanks
The text was updated successfully, but these errors were encountered: