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

[lexical-playground] Bug Fix: Track Resizing Actions for Excalidraw in History Stack #6696

Merged
merged 2 commits into from
Oct 3, 2024

Conversation

neysanfoo
Copy link
Contributor

@neysanfoo neysanfoo commented Oct 3, 2024

Description

Current Behaviour

Excalidraw resizing actions are not tracked. My understanding of this is that because the component is fetching width and height from the editor state rather than receiving them as props, React didn't detect the changes to width and height, preventing the component from rerendering on resizing. And as a result, Lexical did not record these transactions in its history stack.

Changes Introduced

I am now passing in the width and height properties as props into ExcalidrawComponent, similar to what is done in ImageNode. And I got rid of useMemo.

Before

excal_resize_before.mov

After

excal_resize_after.mov

Tested in collab mode as well.

Copy link

vercel bot commented Oct 3, 2024

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 Oct 3, 2024 4:20pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 3, 2024 4:20pm

@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 Oct 3, 2024
@neysanfoo neysanfoo changed the title [lexical-playground] Bug Fix: Track Resizing Actions in Excalidraw in History Stack [lexical-playground] Bug Fix: Track Resizing Actions for Excalidraw in History Stack Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

size-limit report 📦

Path Size
lexical - cjs 29.86 KB (0%)
lexical - esm 29.75 KB (0%)
@lexical/rich-text - cjs 38.45 KB (0%)
@lexical/rich-text - esm 31.58 KB (0%)
@lexical/plain-text - cjs 37.09 KB (0%)
@lexical/plain-text - esm 28.95 KB (0%)
@lexical/react - cjs 40.22 KB (0%)
@lexical/react - esm 32.94 KB (0%)

@ivailop7 ivailop7 added this pull request to the merge queue Oct 3, 2024
Merged via the queue into facebook:main with commit 864a9ae Oct 3, 2024
25 checks passed
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