-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix existing row styles when using spliceRows #737
Conversation
I'm really not familiar with how styles work, but is this related to #722 @Siemienik ? |
@@ -330,6 +330,10 @@ Worksheet.prototype = { | |||
rSrc = this._rows[i - 1]; | |||
if (rSrc) { | |||
this.getRow(i + nExpand).values = rSrc.values; | |||
// eslint-disable-next-line no-loop-func | |||
rSrc.eachCell({ includeEmpty: true }, function(cell, colNumber) { | |||
this.getRow(i + nExpand).getCell(colNumber).style = cell.style; |
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.
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.
@Siemienik do you think that would be necessary because the row that we get the style for each cell gets set to undefined anyway?
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.
I worry about case like this one #669
This PR fixes the style issues reported in #305 and #697 to copy over any existing styles already applied to rows. I have also included additional tests for this fix.