Repository navigation
fix(design-system-react-native): respect reduced motion in Spinner - #1672
Closed
georgewrmarshall wants to merge 1 commit into
Closed
georgewrmarshall wants to merge 1 commit into
georgewrmarshall wants to merge 1 commit into
Conversation
Contributor
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
The native-driver loop from #1665 spins even when the OS reduce-motion setting is on. Reanimated's ReduceMotion.System used to suppress that loop. Read AccessibilityInfo on mount, subscribe to reduceMotionChanged, and hold the icon still while the setting is enabled. Co-authored-by: Juanmi <95381763+juanmigdr@users.noreply.github.com> Co-authored-by: George Marshall <georgewrmarshall@users.noreply.github.com>
cursor
Bot
force-pushed
the
cursor/spinner-reduced-motion-08f8
branch
from
November 6, 2026 23:03
4d3072b to
b567586
Compare
Contributor
📖 Storybook LinksCompare the preview for this pull request with the latest Storybooks from the 🔀 Pull Request Preview
🌳 Main Branch (Latest)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
v81 follow-up to #1665. That PR, by Juanmi (juanmigdr), replaced the Reanimated
withRepeatrotation inSpinnerwith a coreAnimated.loopon the native driver (useNativeDriver: true,isInteraction: false). Continuous Reanimated shadow-tree commits were competing with layout-animation commits on Android and the spinner could stop the app. The native driver rotates the view on the UI thread without those commits.Reanimated's default
ReduceMotion.Systemused to skip that infinite animation when the OS reduce-motion setting was on. The native-driver loop does not consult that setting, so the spinner kept spinning for people who had asked for less motion.This PR only adds that missing check. There is no shared reduced-motion hook in the repo. On mount,
SpinnerreadsAccessibilityInfo.isReduceMotionEnabled()and subscribes toreduceMotionChanged, removing the subscription on unmount. While reduced motion is on, the loop is not started, or it is stopped and rotation is reset to0deg, so the icon shows as a static ring. Turning the setting off starts the same native-driver loop. A parent re-render does not recreate it. A read that resolves after unmount, or after a newerreduceMotionChangedevent, is ignored so the loop does not flicker or update state after unmount. If the platform cannot report the setting, the spinner keeps spinning, which is the previous behavior.Related issues
Builds on #1665, which merged for the v80 release. This does not replace or close that PR.
Manual testing steps
yarn workspace @metamask/storybook-react-native storybook:weband open Temp Components/Spinner (and a loadingButton/ButtonBase, which rendersSpinner).prefers-reduced-motion: reduce, or turn on the OS setting. The icon is a static ring and does not rotate.Screenshots/Recordings
A still before/after is not a useful comparison. The icon artwork is unchanged, and a single frame of a rotating ring does not show whether reduced motion is respected.
Before
With reduced motion off, the ring spins (same as #1665). With reduced motion on, the ring still spun, because the native-driver loop ignored the OS setting.
After
With reduced motion off, the ring spins once per second on the native driver. With reduced motion on, the ring stays still at 0°.
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Single-component UI/accessibility behavior with extensive unit tests; no data, auth, or cross-cutting infra changes.
Reviewed by Cursor Bugbot for commit b567586. Bugbot is set up for automated code reviews on this repo. Configure here.