-
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
Function Transforms. insertFragment
is not working properly when insert a fragment with two paragraphs
#5775
Comments
don't use insertFragment, try insertText, and it works. |
Screen-2024-12-06-150538.mp4 |
@zhugexiaogou666 I know, but insertText is used for insert Text and |
Transforms.insertNodes
is not working properly when insert a fragment with two paragraphsTransforms. insertFragment
is not working properly when insert a fragment with two paragraphs
I know, but the problem now is that the insertFragment api may have bugs. I say this method may meet your current needs.I tried insertText which can also satisfy the paste situation and will not conflict with insertFragment. And this is a case:
|
I'd prefer this bug to be fixed on insertFragment instead of using insertNodes to downgrade to text copy/paste from HTML copy/paste. |
Description
When this function is called to insert a fragment with two paragraphs, the two paragraphs will be merged and inserted as inline nodes.
Steps
To reproduce the behavior:
of doing exactly that
)Expectation
It should create a new paragraph
Environment
Context
The root cause of this issue is the incorrect behavior of
Transforms. insertFragment
when the fragment is two paragraphs.Here is a new test case which can reproduce this issue, please create it in the repo to reproduce.
packages/slate/test/transforms/insertFragment/of-blocks/block-middle-two-blocks.tsx
The text was updated successfully, but these errors were encountered: