Skip to content

Allow importing width and height from table cell and DOM nodes - #4521

Merged
acywatson merged 2 commits into
meta:mainfrom
GMchris:table-size-import
May 23, 2023
Merged

acywatson merged 2 commits into
meta:mainfrom
GMchris:table-size-import

Conversation

@GMchris

@GMchris GMchris commented May 19, 2023

Copy link
Copy Markdown
Contributor

Addresses #4518

@vercel

vercel Bot commented May 19, 2023 •

Copy link
Copy Markdown

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 May 20, 2023 9:30pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2023 9:30pm

@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 May 19, 2023
@acywatson

Copy link
Copy Markdown
Contributor

Historically, the problem with doing things like this is that it can cause something like table cell height to be imported into an editor that doesn't otherwise support row resizing. This would mean the row is sort of "stuck" with the height and the user wouldn't be able to change it in the destination editor. Typically we'd ask users to implement this in a TableCellNode override, but I will defer to @zurfyx if he think this is functionality that should be baked into core tables logic.

@GMchris

GMchris commented May 23, 2023 •

Copy link
Copy Markdown
Contributor Author

I understand this concern, but as far as I can tell this data is also passed with the serialized node, so a copy and paste of a resized column or row from an editor that allows resizing into one that doesn't presents the same "problem" - the cell/row is now "stuck" at this size. In fact importDOM is the only place in these nodes that doesn't attempt to transfer the width/height information.

Just as a counter-point, if resizing should be a custom operation and editor-builders are expected to implement it themselves fully, why do the base Row and Cell Nodes even contain width and height properties.

@acywatson

Copy link
Copy Markdown
Contributor

I understand this concern, but as far as I can tell this data is also passed with the serialized node, so a copy and paste of a resized column or row from an editor that allows resizing into one that doesn't presents the same "problem" - the cell/row is now "stuck" at this size. In fact importDOM is the only place in these nodes that doesn't attempt to transfer the width/height information.

Just as a counter-point, if resizing should be a custom operation and editor-builders are expected to implement it themselves fully, why do the base Row and Cell Nodes even contain width and height properties.

Yes, valid point. Let's do this then.

@acywatson
acywatson merged commit 8e24206 into meta:main May 23, 2023
This was referenced May 23, 2023

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 24a1eb4c Deployed May 20, 2023 by vercel[bot]
Preview – lexical — 24a1eb4c Deployed May 20, 2023 by vercel[bot]
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