Skip to content

Commit

Permalink
[@mantine/core] MantineProvider: Fix jest tests not running in case t…
Browse files Browse the repository at this point in the history
…here is incorrect `window.matchMedia` polyfill implementation (#7360)
  • Loading branch information
Benjaminsson authored Jan 16, 2025
1 parent 4dc995a commit 56b7ce5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function setColorSchemeAttribute(
const hasDarkColorScheme =
typeof window !== 'undefined' &&
'matchMedia' in window &&
window.matchMedia('(prefers-color-scheme: dark)').matches;
window.matchMedia('(prefers-color-scheme: dark)')?.matches;

const computedColorScheme =
colorScheme !== 'auto' ? colorScheme : hasDarkColorScheme ? 'dark' : 'light';
Expand Down

0 comments on commit 56b7ce5

Please sign in to comment.