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

fix Heading.insertNewAfter #5198

Merged
merged 1 commit into from Nov 3, 2023
Merged

Conversation

GermanJablo
Copy link
Contributor

@GermanJablo GermanJablo commented Nov 3, 2023

  • The second parameter of replace had to be true, not restoreSelection which has nothing to do with it.
  • I had to add a select, because otherwise when trying to paste a heading at the beginning of a heading an error would appear. This shouldn't be like this, maybe it's a bug in replace.
  • Inserting a heading at the beginning of a heading does not combine them as part of the same block. I don't think it's the best behavior. I tried to fix it but insertNodes is still tremendously complex despite recent improvements.

Copy link

vercel bot commented Nov 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 2:25am
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 3, 2023 2:25am

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 3, 2023
Copy link
Member

@zurfyx zurfyx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, let's merge this for now! But yeah, something's still off

In here I'm pasting

<meta charset='utf-8'><h1 class="x1603h9y x117nqv4 x1u7k74 xi48ejl x1xmf6yo x1e56ztr" dir="ltr"><span style="white-space: pre-wrap;">Welcome to the playground</span></h1>
Screen.Recording.2023-11-03.at.9.00.38.AM.mov

For GDoc it doesn't even recognize it as a heading

@zurfyx zurfyx merged commit ed8f85f into facebook:main Nov 3, 2023
42 of 45 checks passed
@GermanJablo GermanJablo deleted the fix-insertNodes branch November 3, 2023 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants