Skip to content

Commit

Permalink
[DataGrid] Change test dom check from /jsdom/ to /jsdom|HappyDOM/. (@…
Browse files Browse the repository at this point in the history
…jedesroches) (#15642)

Co-authored-by: Joachim Desroches <129734564+jedesroches@users.noreply.github.com>
Co-authored-by: Joachim Desroches <jo@thedesroches.net>
  • Loading branch information
3 people authored Nov 28, 2024
1 parent 17852ad commit 11793bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ export function useGridDimensions(
rootDimensionsRef.current = size;

// jsdom has no layout capabilities
const isJSDOM = /jsdom/.test(window.navigator.userAgent);
const isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);

if (size.height === 0 && !errorShown.current && !props.autoHeight && !isJSDOM) {
logger.error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ type ScrollCache = ReturnType<typeof createScrollCache>;
let isJSDOM = false;
try {
if (typeof window !== 'undefined') {
isJSDOM = /jsdom/.test(window.navigator.userAgent);
isJSDOM = /jsdom|HappyDOM/.test(window.navigator.userAgent);
}
} catch (_) {
/* ignore */
Expand Down

0 comments on commit 11793bc

Please sign in to comment.