-
-
Notifications
You must be signed in to change notification settings - Fork 530
feat(tables): overhaul table cells #1429
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/core/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts
Show resolved
Hide resolved
I just noticed that after setting text alignment in a cell, the selection closes and formatting toolbar disappears. I don't think it's necessary to fix before merging, but smth we may want to look into next week |
@matthewlipski I took a quick look into this to see what we can do here, and this is what is happening here: BlockNote/packages/react/src/components/FormattingToolbar/DefaultButtons/TextAlignButton.tsx Lines 104 to 115 in add526c
So, the updateBlock call is completely replacing the table content, which causes the selection to be lost in the replaceRange step. What I'd like out of this is 1 of two things, either make the selection more low-level so that we can set the position before & after to allow it to be in the same spot. Or, for the update block function to be smarter & not replace the whole range, just the "affected" porition, making a fine-grained update of the diff of the changes so that it knows it doesn't really need to mess with the selection at all. Maybe even both. Definitely think it is out of scope for the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
had a quick glance at final state. two questions:
- example links to https://www.blocknotejs.org/docs/editor-basics/tables which doesn't exist
- did you want to simplify the types (we discussed this last week) or keep as is for now?
Also; enjoy the fun of closing all related issues 🙌🎉
Whoops, meant to link to advanced tables, I renamed it somewhere
Sorry, meant to write something about why I decided not to do this atm. Basically it came down to:
|
💖 This feature is sponsored by Agree.com
This PR is attempting to address the following for table cells:
Screen.Recording.2025-02-20.at.14.19.23.mp4