microsoft / fluentui-react-native

A react-native component library that implements the Fluent Design System.

Home Page:https://developer.microsoft.com/fluentui

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Switch's reduced motion check needs review

amgleitman opened this issue · comments

const isReduceMotionEnabled = AccessibilityInfo.isReduceMotionEnabled;
const thumbAnimation = isReduceMotionEnabled ? { animationClass: 'Ribbon_SwitchThumb' } : null;

This was discovered while investigating turning on strict null checks everywhere.

AccessibilityInfo.isReduceMotionEnabled is a function, so thumbAnimation will always choose the "true" option. Is this really what we want? I've noticed that reduce motion doesn't seem to affect native slide switches on macOS and iOS, and the FURN switch reflects that behavior, although other platforms might be a different story. We should double check this.