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

Bug: Pasting text from the clipboard into a CustomElementNode does not work properly #6477

Open
DanielMaass opened this issue Jul 30, 2024 · 0 comments · May be fixed by #6493
Open

Bug: Pasting text from the clipboard into a CustomElementNode does not work properly #6477

DanielMaass opened this issue Jul 30, 2024 · 0 comments · May be fixed by #6493

Comments

@DanielMaass
Copy link

DanielMaass commented Jul 30, 2024

If you define a CustomElementNode class with isInline(): true and/or canBeEmpty(): true, then no text can be inserted from the clipboard. In this case, the text is inserted after the CustomElementNode. The same applies to adding DecoratorNodes. I assume that no nodes of any kind can be added to the CustomElementNode as a child.
But if isInline():false and canBeEmpty():false, then it works as expected.

Lexical version: 0.16.1

Link to code example:
https://stackblitz.com/edit/vitejs-vite-qmtgsj

The current behavior

After inserting text from the clipboard (or adding a new node, such as a DecoratorNode) into the CustomElementNode, the text appears after the CustomElementNode

The expected behavior

Text from clipboard (or new DecoratorNode) should added at current cursor position

Impact of fix

HIGH
It affects all classes that extend from ElementNode and that may not be empty or are inline elements.

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

Successfully merging a pull request may close this issue.

1 participant