react / react/react-native

Modal `formSheet` backdrop fade animation missing on first modal creating unsmooth experience.

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

Chưa có ai nhận issue này.

Component: Modal Needs: Triage :mag:
Ngôn ngữ chính
C++
Star
127k
Fork
25.3k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
4

Mô tả

Description

When presenting a <Modal> with presentationStyle="formSheet" and animationType="slide", the backdrop dimming overlay does not fade in on physical iOS devices. Instead, the dimming appears instantly without animation when the first modal opens, results in a jarring, unsmooth appearance when opening modals.

Native apps do not have this problem, so it is unfortunate that all react-native apps suffer from this visual downgrade.

The modal sheet itself slides up correctly, only the backdrop transition is broken.

Notably:

  • The second modal's backdrop animates correctly
  • Modal dismissal backdrop fade-out always works correctly
  • The iOS Simulator works correctly - the bug only appears on physical hardware

This was originally reported against react-native-screens (https://github.com/software-mansion/react-native-screens/issues/2977), but the issue reproduces with React Native's built-in <Modal>.

Steps to reproduce
  1. Create a fresh React Native 0.84 project
  2. Use the reproduction code below
  3. Build and run on a physical iOS device
  4. Tap "Open Modal 1" — observe the backdrop appears instantly (no fade)
  5. Tap "Open Modal 2" — observe the backdrop fades in correctly this time
  6. Close both modals and repeat — the first modal's backdrop never animates
React Native Version

0.84.0

Affected Platforms

Runtime - iOS

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.6
  CPU: (14) arm64 Apple M4 Pro
  Memory: 3.64 GB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 22.13.0
    path: /Users/kris/.nvm/versions/node/v22.13.0/bin/node
  Yarn:
    version: 1.22.22
    path: /Users/kris/.nvm/versions/node/v22.13.0/bin/yarn
  npm:
    version: 10.9.2
    path: /Users/kris/.nvm/versions/node/v22.13.0/bin/npm
  Watchman:
    version: 2024.12.02.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/kris/.rbenv/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.4
      - iOS 18.4
      - macOS 15.4
      - tvOS 18.4
      - visionOS 2.4
      - watchOS 11.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.2 AI-242.23726.103.2422.12816248
  Xcode:
    version: 16.3/16E140
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.13
    path: /usr/bin/javac
  Ruby:
    version: 3.1.6
    path: /Users/kris/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 20.1.0
    wanted: 20.1.0
  react:
    installed: 19.2.3
    wanted: 19.2.3
  react-native:
    installed: 0.84.1
    wanted: 0.84.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
None
MANDATORY Reproducer

https://snack.expo.dev/@supermelle/modal-native

Screenshots and Videos

In this video it it shown, how the animation on the first backdrop is missing, and also how it is working on the second modal.

https://github.com/user-attachments/assets/ba417a57-1b14-44b2-a197-59d5f3ffb3fa

Hướng dẫn đóng góp

Mở 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.

Hướng nghiên cứu

Bắt đầu với trình tái hiện Snack bắt buộc và chạy nó trên một thiết bị iOS thực, so sánh modal formSheet thứ nhất và thứ hai với animationType="slide". Theo dõi đường dẫn trình bày tích hợp của React Native Modal cho quá trình chuyển tiếp backdrop. Hoàn thành khi backdrop của modal thứ nhất mờ dần vào một cách mượt mà trên phần cứng thực, trong khi thao tác loại bỏ và các modal tiếp theo vẫn hoạt động chính xác.

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

Đánh giá

Công nghệ
react-native
Lĩnh vực
mobile-dev
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/100

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.