-
-
Notifications
You must be signed in to change notification settings - Fork 73
Conversation
… overflowing rows
package.json
Outdated
@@ -1,6 +1,6 @@ | |||
{ | |||
"name": "dash-table", | |||
"version": "3.1.0rc11", | |||
"version": "3.1.0rc12", |
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.
bump version
data: Data, | ||
overflowColumns: boolean = true, | ||
overflowRows: boolean = true | ||
): { data: Data, columns: Columns } | void => { |
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.
Isolated the pasting logic so it's not dependent on sheetclip and the clipboard event. Makes unit testing cleaner.
derived_viewport_indices[viewportIndex] : | ||
overflowRows ? | ||
lastEntry + (viewportIndex - viewportSize + 1) : | ||
undefined; |
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.
This is where the main change is. If the row falls in the existing (non-appended) data, map it directly to the viewport indices, if not, map it to the last entry of the viewport + offset, if overflow is not supported return undefined instead (will be validated below to exclude those rows from being processed)
import applyClipboardToData from 'dash-table/utils/applyClipboardToData'; | ||
|
||
describe('clipboard', () => { | ||
describe('with column/row overflow allowed', () => { |
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.
Various tests to validate behavior when copying n rows into a m rows dataframe with overflow allowed (new rows get appended)
}); | ||
|
||
describe('with column overflow allowed', () => { | ||
it('pastes one line at [0, 0] in one line df', () => { |
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.
Various tests to validate behavior when copying n rows into a m rows dataframe with overflow unallowed (no new rows appended)
…aste # Conflicts: # CHANGELOG.md # dash_table/bundle.js # dash_table/demo.js
The |
…aste # Conflicts: # CHANGELOG.md # dash_table/bundle.js # dash_table/demo.js # src/dash-table/utils/TableClipboardHelper.ts
@valentijnnieman Not experiencing issues with the local tests and CI seems fine / stable. Will merge and we can have another look at the environment after. |
Fixes #142.
The table currently supports copy/paste that exceeds the number of rows in the viewport if no sorting and no filtering is applied. The code appended the required rows at the end of the data but failed to map to the new rows when pasting -- effectively pasting to the existing rows and adding empty rows without pasting the values to them.
This PR fixes this behavior and adds a few unit tests to validate the paste behavior.