Skip to content

[lexical-playground] Fix: use inline style for LayoutContainerNode import#8214

Merged
etrepum merged 2 commits intofacebook:mainfrom
WhyBusyy:fix/layout-container-import
Mar 12, 2026
Merged

[lexical-playground] Fix: use inline style for LayoutContainerNode import#8214
etrepum merged 2 commits intofacebook:mainfrom
WhyBusyy:fix/layout-container-import

Conversation

@WhyBusyy
Copy link
Contributor

Summary

  • $convertLayoutContainerElement used window.getComputedStyle() which returns empty values for unmounted DOM nodes during HTML import
  • Since exportDOM() stores gridTemplateColumns as an inline style, read it directly via domNode.style.gridTemplateColumns

Fixes #6813

Test plan

  • Create a 2-column layout in the playground editor
  • Export as HTML ($generateHtmlFromNodes)
  • Re-import the exported HTML ($generateNodesFromDOM)
  • Verify the layout container node is correctly reconstructed with the original column template

🤖 Generated with Claude Code

…tContainerNode import

$convertLayoutContainerElement used window.getComputedStyle() which
returns empty values for unmounted DOM nodes during HTML import.
Since exportDOM() writes gridTemplateColumns as an inline style,
read it directly via domNode.style.gridTemplateColumns instead.

Fixes facebook#6813

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexical Ready Ready Preview, Comment Mar 12, 2026 6:57am
lexical-playground Ready Ready Preview, Comment Mar 12, 2026 6:57am

Request Review

@meta-cla
Copy link

meta-cla bot commented Mar 12, 2026

Hi @WhyBusyy!

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!

@etrepum
Copy link
Collaborator

etrepum commented Mar 12, 2026

I’ll review after the CLA is signed and this PR has tests that demonstrate that the change works as expected

@WhyBusyy
Copy link
Contributor Author

@etrepum Already signed! Thanks for the quick review!

…export

Verify that LayoutContainerNode correctly reads gridTemplateColumns
from inline style during DOM import, covering export, import, and
round-trip scenarios.
@meta-cla meta-cla 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 12, 2026
@etrepum etrepum added the extended-tests Run extended e2e tests on a PR label Mar 12, 2026
@etrepum etrepum changed the title fix(playground): use inline style for LayoutContainerNode import [lexical-playground] Fix: use inline style for LayoutContainerNode import Mar 12, 2026
@etrepum etrepum added this pull request to the merge queue Mar 12, 2026
Merged via the queue into facebook:main with commit a991909 Mar 12, 2026
40 checks passed
@etrepum etrepum mentioned this pull request Mar 19, 2026
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. extended-tests Run extended e2e tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: The $convertLayoutContainerElement function of LayoutContainerNode always returns null

2 participants