-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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-table] Fix table cell format for selection within cell #6582
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
Hi @ivailop7, I know it's not my place to say. But given you are able to reproduce and demonstrate this issue in the playground, it should also be possible to write an e2e test for this. Given there are many organizations that rely on this codebase, would you be willing to write one, or otherwise specify in your PR description why tests were not included for this change? |
This kinda seems like something that should be handled by the selection class rather than a command? Since we do have a paragraph in every cell maybe it makes sense not to store this format there at all since it can and should already be stored on the paragraph (per #6583) |
Yeah, that's probably a better approach and would make preserving the styling on empty cells more consistent. Need to redo it, but my holidays ended, so don't have as much time to do PRs. Will revisit in the coming weeks. |
Currently, the TableCellNode tracks the format of the paragraph inside. This is applied correctly when selection is via table selection (range selection including a table, whole table selection, cells selection).
There is a collection of cases if it's selection within the table cell, since the table cell is not selected the format doesn't propagate to the parent TableCellNode correctly and things get out of sync. This fixes those cases.
Before:
before.mov
After:
Things are in sync
after.mov