Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/6pac/SlickGrid
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Dec 9, 2023
2 parents da72bb1 + e7ccc1d commit b97d516
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/models/gridOption.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ export interface GridOption<C extends BaseColumn = BaseColumn> {
/** Default cell Formatter that will be used by the grid */
defaultFormatter?: Formatter;

/** Escape hatch geared towards testing Slickgrid in jsdom based environments to circumvent the lack of stylesheet.ownerNode and clientWidth calculations */
devMode?: false & { ownerNodeIndex?: number; containerClientWidth?: number; };
/** Escape hatch geared towards testing Slickgrid in JSDOM based environments to circumvent the lack of stylesheet.ownerNode and clientWidth calculations */
devMode?: false | { ownerNodeIndex?: number; containerClientWidth?: number; };

/** Do we have paging enabled? */
doPaging?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions src/slick.grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2468,7 +2468,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
if (!this.stylesheet) {
const sheets: any = (this._options.shadowRoot || document).styleSheets;

if (typeof this.options.devMode?.ownerNodeIndex === "number" && this.options.devMode.ownerNodeIndex >= 0) {
if (this.options.devMode && typeof this.options.devMode?.ownerNodeIndex === "number" && this.options.devMode.ownerNodeIndex >= 0) {
sheets[this.options.devMode.ownerNodeIndex].ownerNode = this._style;
}

Expand Down Expand Up @@ -4290,7 +4290,7 @@ export class SlickGrid<TData = any, C extends Column<TData> = Column<TData>, O e
}

getViewportWidth() {
this.viewportW = parseFloat(Utils.innerSize(this._container, 'width') as unknown as string) || this.options.devMode?.containerClientWidth || 0;
this.viewportW = parseFloat(Utils.innerSize(this._container, 'width') as unknown as string) || (this.options.devMode && this.options.devMode.containerClientWidth) || 0;
return this.viewportW;
}

Expand Down

0 comments on commit b97d516

Please sign in to comment.