We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8ef08a7 commit 6908fd0Copy full SHA for 6908fd0
src/internal/visual-mode/index.ts
@@ -12,7 +12,7 @@ import { awsuiVisualRefreshFlag, getGlobal } from '../global-flags';
12
export function isMotionDisabled(element: HTMLElement): boolean {
13
return (
14
!!findUpUntil(element, node => node.classList.contains('awsui-motion-disabled')) ||
15
- (window.matchMedia?.('(prefers-reduced-motion: reduce)').matches ?? false)
+ (element?.ownerDocument?.defaultView?.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ?? false)
16
);
17
}
18
0 commit comments