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

Table issues #1762

Closed
dylans opened this issue Aug 5, 2022 · 2 comments
Closed

Table issues #1762

dylans opened this issue Aug 5, 2022 · 2 comments
Labels
bug Something isn't working plugin:table Tables

Comments

@dylans
Copy link
Collaborator

dylans commented Aug 5, 2022

Description

A few issues with tables

Crashes with pasting a plate table selection into a plate table cell

The path parameters for setting the selection after inserting a table fragment into an existing table is not quite correct. It passes the existing tests somewhat by coincidence, but breaks with other syntax trees.

I used a workaround similar to that used in other places in Plate,

            if (lastCellPath) {
              select(editor, {
                anchor: getStartPoint(editor, startCellPath),
                focus: getEndPoint(editor, lastCellPath),
              });
            }

which works fairly well. Existing tests still pass, and it no longer crashes in my app. Unfortunately I've not really been able to clearly isolate a failing unit test that I trust.

However, sometimes copy/paste then inserts an extra cell, overwriting an additional cell in the table or adding an empty row to the right side. The source copy/paste buffer seems to be hanging over the cell but it isn't visually. I think the selection mechanism may be grabbing just over the boundary of the cell but not the children.

It's also a bit odd that copy/paste always overwrites the cell, even if the new cell doesn't have its contents highlighted. I would expect a single cell copy to be treated as if you wanted to insert content into the cell, not replace it. Perhaps the current behavior matches spreadsheets, but it's not really clear in the UI how to just grab a portion of the table cell's contents rather than all of the contents.

Selection in Firefox is very broken.

The resize splitters are a bit flaky (I tested in Firefox, but perhaps in other browsers as well).

This could be split into separate issues, but it might make sense to work on these issues together so I'll leave it as one issue for now.
Environment

  • plate: 16.0.1
  • slate: 0.82.0
  • slate-react: 0.82.0
  • browser: all
@dylans dylans added the bug Something isn't working label Aug 5, 2022
@zbeyens zbeyens added the plugin:table Tables label Aug 8, 2022
@zbeyens
Copy link
Member

zbeyens commented Aug 11, 2022

It's also a bit odd that copy/paste always overwrites the cell, even if the new cell doesn't have its contents highlighted. I would expect a single cell copy to be treated as if you wanted to insert content into the cell, not replace it. Perhaps the current behavior matches spreadsheets, but it's not really clear in the UI how to just grab a portion of the table cell's contents rather than all of the contents.

udecode/editor-protocol#63

@zbeyens
Copy link
Member

zbeyens commented Aug 15, 2022

@zbeyens zbeyens closed this as completed Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin:table Tables
Projects
None yet
Development

No branches or pull requests

2 participants