react / react/react-native

ScrollView does not work inside position: absolute on Android.

Đang mở
#38,730 25 bình luận 9 reaction 0 người được giao Xem trên GitHub

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

Component: ScrollView Issue: Author Provided Repro Needs: Triage :mag: Newer Patch Available Platform: Android
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

ScrollView does not work inside position: absolute on Android. Scrolling works on iOS.

React Native Version

0.71.11

Output of npx react-native info

System:
OS: macOS 12.6.4
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 131.35 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.0 - ~/.nvm/versions/node/v16.14.0/bin/node
Yarn: 1.22.17 - /usr/local/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.0/bin/npm
Watchman: 2023.04.03.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.12.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2022.1 AI-221.6008.13.2211.9514443
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 19.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.11 => 0.71.11
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

ScrollView does not work inside position: absolute on Android. Scrolling works on iOS.

 <View style={{ height: 300, paddingTop: 100 }}>
       <View
         style={{
           position: 'relative',
           height: 40,
           borderColor: 'red',
           borderWidth: 1,
         }}>
         <View
           style={{
             height: 60,
             position: 'absolute',
             width: '100%',
             borderColor: 'green',
             borderWidth: 1,
             zIndex: 1000,
             elevation: 1000,
           }}>
           <ScrollView>
             <Text>1</Text>
             <Text>2</Text>
             <Text>3</Text>
             <Text>4</Text>
             <Text>5</Text>
             <Text>6</Text>
           </ScrollView>
         </View>
       </View>
     </View>
Snack, screenshot, or link to a repository

https://snack.expo.dev/3enX3_UHW

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 bản tái hiện Snack được liên kết và chạy nó trên Android, sau đó so sánh hành vi của ScrollView với iOS. Theo dõi cách React Native xử lý các phần tử con của ScrollView bên trong một View được định vị tuyệt đối và xác định lỗi chỉ xảy ra trên Android. Hoàn thành khi ví dụ cuộn chính xác trên Android mà không làm hồi quy hành vi đang hoạt động trên iOS.

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

Đánh giá

Công nghệ
android, react-native
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/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.