Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Issue 611 - Hidden columns on copy/paste#621

Merged
Marc-Andre-Rivet merged 5 commits intodevfrom
611-copy-paste-hideable-columns
Oct 17, 2019
Merged

Issue 611 - Hidden columns on copy/paste#621
Marc-Andre-Rivet merged 5 commits intodevfrom
611-copy-paste-hideable-columns

Conversation

@Marc-Andre-Rivet
Copy link
Copy Markdown
Contributor

@Marc-Andre-Rivet Marc-Andre-Rivet commented Oct 9, 2019

Fixes #611

Similarly to what's being done elsewhere, the clipboard needs to take into consideration both the visible columns and all the available columns when handling a copy/paste operation.

The last visible column is used to determine placement and whether new columns are required, all columns are used to determine the final set of columns if new ones are needed and their final placement based on visible ones.

Added two tests to the clipboard to check the behavior when there are hidden columns.

@chriddyp chriddyp temporarily deployed to dash-table-review-pr-621 October 9, 2019 03:28 Inactive
newColumns
);

newVisibleColumns = R.concat(newVisibleColumns, _newColumns);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When new columns are created, they are appended after the last visible column. Both visible and "all" columns are updated to both (1) handle the copy/paste below and (2) the columns update correctly.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm OK - I might have added the new columns after trailing hidden columns as well, but it's probably impossible to declare one way objectively better than the other. This is fine.

expect(Object.entries(res.data[0]).length).to.equal(3);
expect(res.columns.length).to.equal(3);
expect(res.columns[0].id).to.equal('c1');
expect(res.columns[1].id).to.equal('c2');
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check that all columns are present and in the right order after a copy/paste operation involving hidden columns

@Marc-Andre-Rivet Marc-Andre-Rivet marked this pull request as ready for review October 9, 2019 03:33
Copy link
Copy Markdown
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, apologies for letting this sit unreviewed so long! 💃

@Marc-Andre-Rivet Marc-Andre-Rivet merged commit 7c00055 into dev Oct 17, 2019
@Marc-Andre-Rivet Marc-Andre-Rivet deleted the 611-copy-paste-hideable-columns branch October 17, 2019 12:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hideable columns disappear after pasting data into table?

3 participants