Skip to content

Commit

Permalink
chore: workaround for jsdom limitation when unit testing (#1602)
Browse files Browse the repository at this point in the history
this fixes a limitation of jsdom which caused unit tests with vitest/jsdom to fail in components using the slickgrid-universal component
  • Loading branch information
zewa666 committed Jul 12, 2024
1 parent 0fca28d commit 53b9437
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/common/src/core/slickGrid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2793,8 +2793,12 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
w = this.columns[i].width || 0;

rule = this.getColumnCssRules(i);
rule.left.style.left = `${x}px`;
rule.right.style.right = (((this._options.frozenColumn !== -1 && i > this._options.frozenColumn!) ? this.canvasWidthR : this.canvasWidthL) - x - w) + 'px';
if (rule.left) {
rule.left.style.left = `${x}px`;
}
if (rule.right) {
rule.right.style.right = (((this._options.frozenColumn !== -1 && i > this._options.frozenColumn!) ? this.canvasWidthR : this.canvasWidthL) - x - w) + 'px';
}

// If this column is frozen, reset the css left value since the
// column starts in a new viewport.
Expand Down Expand Up @@ -6387,4 +6391,4 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
}
return this._options.sanitizer(dirtyHtml) as T;
}
}
}

0 comments on commit 53b9437

Please sign in to comment.