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

LinkExtension autoLink interferes with TableExtension copy/paste #1824

Closed
labkey-alan opened this issue Aug 22, 2022 · 0 comments · Fixed by #1836
Closed

LinkExtension autoLink interferes with TableExtension copy/paste #1824

labkey-alan opened this issue Aug 22, 2022 · 0 comments · Fixed by #1836
Labels
type: bug 🪲 Something isn't working

Comments

@labkey-alan
Copy link

Summary

When using the TableExtension in combination with the LinkExtension with autoLink set to true copying a column of data from one table to another results in a nested table being pasted, instead of the column contents spanning multiple rows.

Steps to reproduce

Setup a remirror editor with the following extensions:

const extensions = (): Extension[] => [
    ...corePreset({}),
    // autoLink automatically converts pasted URLs into links
    new LinkExtension({ autoLink: true }),
    new TableExtension({}),
];

Insert a table (3x3), enter data into the table that looks something like this:

Screen Shot 2022-08-22 at 5 20 41 PM

Copy the first column of data, create another 3x3 table, and paste into the top cell of one of the columns.

Expected results

I would expect the pasted column data to be inserted across the same number of rows I copied from like this:

Screen Shot 2022-08-22 at 5 22 13 PM

Actual results

A new table is pasted inside the cell that I have pasted into, like this:

Screen Shot 2022-08-22 at 5 23 27 PM

Possible Solution

I suspect, though I have not confirmed, that maybe the link extension is doing something to the data being pasted, but not handling the paste event, so by the time the table extension handles the event it's getting malformed data? I will hopefully have time to investigate this theory tomorrow.

If I disable autoLink, or remove the LinkExtension from my extension list, the copy/paste from one table to another always works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🪲 Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant