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

After removing a ListItemNode, merge its siblings. #4035

Merged
merged 4 commits into from
Mar 8, 2023
Merged

After removing a ListItemNode, merge its siblings. #4035

merged 4 commits into from
Mar 8, 2023

Conversation

Awjin
Copy link
Contributor

@Awjin Awjin commented Mar 6, 2023

Properly handles siblings that contain nested lists.

Before:

bug.mov

After:

bug.fix.mov

@vercel
Copy link

vercel bot commented Mar 6, 2023

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

Name Status Preview Comments Updated
lexical ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 7, 2023 at 2:22AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 7, 2023 at 2:22AM (UTC)

@facebook-github-bot
Copy link
Contributor

Hi @Awjin!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@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 Mar 6, 2023
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@@ -0,0 +1,33 @@
/**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI these utils are pretty similar to those in lexical-playground/__tests__/utils. At some point it might be worth extracting both into lexical/src/__tests__/utils.

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point. We once had designs around exposing these utils to the world, as well. Could be interesting to explore at some point.

@@ -196,8 +287,24 @@ describe('LexicalListItemNode tests', () => {
listItemNode3.replace(paragraphNode);
});

expect(testEnv.outerHTML).toBe(
'<div contenteditable="true" style="user-select: text; white-space: pre-wrap; word-break: break-word;" data-lexical-editor="true"><ul><li value="1" dir="ltr"><span data-lexical-text="true">one</span></li><li value="2" dir="ltr"><span data-lexical-text="true">two</span></li></ul><p><br></p></div>',
expectHtmlToBeEqual(
Copy link
Contributor

Choose a reason for hiding this comment

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

ah, we already have a util called assertHTML - I'm so sorry for the churn. I should have been clearer.

We can merge this to get the fix and then do that cleanup later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, thanks. I assume we'd want to extract assertHTML from lexical-playground's test utils, into lexical's? If so we have to migrate the playground tests to ts first

@acywatson acywatson merged commit ff10fa5 into facebook:main Mar 8, 2023
@acywatson acywatson mentioned this pull request Mar 8, 2023
@zurfyx zurfyx mentioned this pull request Mar 24, 2023
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.

3 participants