[iOS] Button press feedback invisible on quick taps when Reduce Motion is enabled

Đang mở
#4,707 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

@andreialecu đang làm issue này rồi.

Từ ngày 21/11/2026.

  • #4708 của @andreialecu — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Lĩnh vực
accessibility, mobile

Hướng nghiên cứu

Start with handleAnimatePressOut in apple/RNGestureHandlerButton.mm, where a short tap's remaining hold is forced to 0 under UIAccessibilityIsReduceMotionEnabled(). Then check animateUnderlayToOpacity:duration: and animateTarget:toOpacity:scale:duration:, which also zero their durations. Done means a quick tap with Reduce Motion on still shows the opacity and underlay change for tapAnimationInDuration, while the activeScale motion stays removed. The web equivalent is prefersReducedMotion() in GestureHandlerButton.web.tsx.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Missing info Platform: iOS Platform: MacOS
Description

With Reduce Motion turned on in iOS, a quick tap on a native button (Touchable, RectButton, BorderlessButton, ...) shows no press feedback at all. The activeOpacity dim and the activeUnderlayOpacity highlight are both affected. Only a press held longer than tapAnimationInDuration shows anything.

This shows up most inside a ScrollView. There, delaysContentTouches hands the button press-in and press-out together on a quick tap, so the elapsed press time is ~0 ms and every tap takes the short path described below.

Cause, in apple/RNGestureHandlerButton.mm (since #4197):

So the active state is set and then reset within the same frame, and it never reaches the screen.

Apple's Reduce Motion guidance asks apps to remove motion (scaling, sliding, zooming). It does not ask them to remove feedback: a dissolve, highlight fade or color change is the recommended replacement. Only the activeScale animation should be affected. The opacity and underlay changes should still be shown, at minimum held for tapAnimationInDuration like they are without Reduce Motion.

Code reading only, not verified on a device: web has the same prefersReducedMotion() ? 0 : remaining in GestureHandlerButton.web.tsx. Android scales the hold by the animator duration scale (here), so with animations removed (scale 0) it would collapse the same way.

Steps to reproduce
  1. Turn on Settings > Accessibility > Motion > Reduce Motion on an iPhone or simulator.
  2. Render buttons inside a ScrollView:
import { Text } from 'react-native';
import { ScrollView, Touchable } from 'react-native-gesture-handler';

export default function Repro() {
  return (
    <ScrollView contentContainerStyle={{ padding: 24, gap: 16 }}>
      <Touchable activeOpacity={0.3} onPress={() => {}} style={{ padding: 24, backgroundColor: 'tomato' }}>
        <Text>activeOpacity</Text>
      </Touchable>
      <Touchable
        underlayColor="black"
        activeUnderlayOpacity={0.3}
        onPress={() => {}}
        style={{ padding: 24, backgroundColor: 'gold' }}>
        <Text>underlay</Text>
      </Touchable>
    </ScrollView>
  );
}
  1. Tap each button quickly.

Expected: each tap briefly dims or highlights the button, the same as with Reduce Motion off. An instant change instead of a fade is fine.
Actual: nothing is visible. Holding the press does show the active state. Turning Reduce Motion off brings the feedback back.

On 3.3.0, an iPhone 17 Pro simulator (iOS 27.2), quick taps on activeUnderlayOpacity buttons showed nothing with Reduce Motion on, while a long press did. With the change in #4708 applied to 3.3.0 as a patch, a screen recording of a quick tap with Reduce Motion on shows the underlay at the same peak as with it off, for ~150 ms (50 ms in, 100 ms out).

A link to a Gist, an Expo Snack or a link to a repository based on this template that reproduces the bug.

The repro is the single component inline above: it needs nothing beyond react-native-gesture-handler, and only the Reduce Motion setting changes the result.

Gesture Handler version

3.3.0 (also present on main at c09aaa6af4d4e9f5189247b59f72d5124b3911f2)

React Native version

0.88.1

Platforms

iOS

JavaScript runtime

Hermes

Workflow

Using Expo Prebuild or an Expo development build

Build type

Debug mode

Device

iOS simulator

Device model

iPhone 17 Pro simulator, iOS 27.2

Acknowledgements

Yes

Related libraries installed: Expo SDK 58 (expo 58.0.26), react-native-reanimated 4.7.1, react-native-worklets 0.13.0, react-native-screens 4.30.1 (none involved: the bug is in the native button).

Ngôn ngữ chính
TypeScript
Star
6.8k
Fork
1.1k
Merge trung bình
2 ngày 17 giờ
Pull request đã merge (30 ngày)
28

Chuẩn bị môi trường

  • Không có Dockerfile hay tệp Docker Compose
  • Có mẫu pull request
  • Không có hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của software-mansion/react-native-gesture-handler

Tất cả issue của software-mansion/react-native-gesture-handler

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.