Skip to content

Commit

Permalink
[Data Grid]fix:set style only if querySelector returns an element
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunrajput committed May 6, 2024
1 parent 05c2c21 commit 6456fda
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,12 @@ export const useGridPrintExport = (
const gridFooterElement: HTMLElement | null = gridClone.querySelector(
`.${gridClasses.footerContainer}`,
);
gridFooterElement!.style.position = 'absolute';
gridFooterElement!.style.width = '100%';
gridFooterElement!.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;

if (gridFooterElement) {
gridFooterElement!.style.position = 'absolute';
gridFooterElement!.style.width = '100%';
gridFooterElement!.style.top = `${computedTotalHeight - gridFooterElementHeight}px`;
}

// printDoc.body.appendChild(gridClone); should be enough but a clone isolation bug in Safari
// prevents us to do it
Expand Down

0 comments on commit 6456fda

Please sign in to comment.