Skip to content

[General] Support reduced motion/animation scale for button animations#4197

Merged
j-piasecki merged 4 commits into
mainfrom
@jpiasecki/touchable-reduced-motion
May 27, 2026
Merged

[General] Support reduced motion/animation scale for button animations#4197
j-piasecki merged 4 commits into
mainfrom
@jpiasecki/touchable-reduced-motion

Conversation

@j-piasecki
Copy link
Copy Markdown
Member

Description

Updates the native button component to respect

  • Reduce motion on iOS
  • Animator duration scale on Android
  • prefers-reduced-motion: reduce on web

for the animation its running

Test plan

Tested on the existing Touchable examples

Android iOS
Screen.Recording.2026-05-26.at.14.22.25.mov
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-05-26.at.14.23.09.mov

Web:

Screen.Recording.2026-05-26.at.15.06.32.mov

Copilot AI review requested due to automatic review settings May 26, 2026 13:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the native gesture-handler-backed button animations to respect system motion/animation scaling settings, so press-in/press-out feedback doesn’t animate when users have reduced-motion enabled (iOS/macOS) or animation duration scale set to 0 (Android).

Changes:

  • iOS/macOS: Added a reduce-motion check and collapses animation durations/delays to zero when enabled.
  • Android: Reads the system animator duration scale and uses it to (a) decide when to snap instead of animating and (b) align the scheduled press-out timing with scaled animator completion.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/react-native-gesture-handler/apple/RNGestureHandlerButton.mm Adds shouldReduceMotion() and forces button press animations/delays to run instantly when Reduce Motion is enabled.
packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt Incorporates Android animator duration scale into “snap vs animate” decision and press-out scheduling.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

@j-piasecki j-piasecki requested a review from m-bert May 26, 2026 14:04
Comment thread packages/react-native-gesture-handler/src/components/GestureHandlerButton.web.tsx Outdated
@j-piasecki j-piasecki merged commit 7465956 into main May 27, 2026
8 checks passed
@j-piasecki j-piasecki deleted the @jpiasecki/touchable-reduced-motion branch May 27, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants