diff options
Diffstat (limited to 'src/components/molecules/forms/motion-toggle.tsx')
| -rw-r--r-- | src/components/molecules/forms/motion-toggle.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/components/molecules/forms/motion-toggle.tsx b/src/components/molecules/forms/motion-toggle.tsx index ec2d950..ad47b33 100644 --- a/src/components/molecules/forms/motion-toggle.tsx +++ b/src/components/molecules/forms/motion-toggle.tsx @@ -13,7 +13,7 @@ export type MotionToggleValue = 'on' | 'off'; export type MotionToggleProps = Pick< RadioGroupProps, - 'bodyClassName' | 'groupClassName' | 'legendClassName' + 'bodyClassName' | 'groupClassName' | 'legendClassName' | 'legendPosition' > & { /** * True if motion should be reduced by default. @@ -41,7 +41,8 @@ const MotionToggle: FC<MotionToggleProps> = ({ defaultValue === 'on' ? false : true ); useAttributes({ - element: document.documentElement || undefined, + element: + typeof window !== 'undefined' ? document.documentElement : undefined, attribute: 'reduced-motion', value: `${isReduced}`, }); |
