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

MaxLength handle empty ElementNode #5029

Merged
merged 2 commits into from
Sep 27, 2023
Merged

MaxLength handle empty ElementNode #5029

merged 2 commits into from
Sep 27, 2023

Conversation

zurfyx
Copy link
Member

@zurfyx zurfyx commented Sep 20, 2023

Iteration on #5020 to handle any empty ElementNode anywhere on the content

@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 Sep 20, 2023
@vercel
Copy link

vercel bot commented Sep 20, 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 Sep 27, 2023 7:28pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 27, 2023 7:28pm

@github-actions
Copy link

github-actions bot commented Sep 20, 2023

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
packages/lexical/dist/Lexical.js 28.27 KB (0%) 566 ms (0%) 261 ms (+40.38% 🔺) 826 ms
packages/lexical-rich-text/dist/LexicalRichText.js 39.55 KB (0%) 792 ms (0%) 260 ms (-25.16% 🔽) 1.1 s
packages/lexical-plain-text/dist/LexicalPlainText.js 39.53 KB (0%) 791 ms (0%) 351 ms (-41.2% 🔽) 1.2 s

Copy link
Contributor

@fantactuka fantactuka left a comment

Choose a reason for hiding this comment

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

🚀

Comment on lines 176 to 177
const lastDescendant: null | LexicalNode =
currentNode.getLastDescendant();
Copy link
Contributor

Choose a reason for hiding this comment

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

nit

Suggested change
const lastDescendant: null | LexicalNode =
currentNode.getLastDescendant();
const lastDescendant = currentNode.getLastDescendant<LexicalNode>();

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the second part, TS is asking me to keep the type based on the assignation afterwards

Screenshot 2023-09-27 at 3 24 41 PM

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