react / react/react-native

[Android] `ScrollView` shows top margin on top of the content when reaching the end

Đang mở
#40,858 0 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: ScrollView Issue: Author Provided Repro Needs: Triage :mag: 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

When having a ScrollView with overflow: 'visible' and some marginTop, this margin is shown on top of the ScrollView content when the end of the ScrollView is reached.

I have been able to reproduce this on a Pixel 6 running Android 13 and Android 14, and on an emulator running Android 12.
It works fine on Android 11.

Demo

https://github.com/facebook/react-native/assets/6463569/fdbf5012-2564-4c7e-aaa1-9bd4111d779b

React Native Version

0.72.5

Output of npx react-native info
System:
  OS: macOS 13.5
  CPU: (10) arm64 Apple M1 Pro
  Memory: 98.53 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 16.20.2
    path: ~/.nvm/versions/node/v16.20.2/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 8.19.4
    path: ~/.nvm/versions/node/v16.20.2/bin/npm
  Watchman:
    version: 2023.07.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods: Not Found
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 22.4
      - iOS 16.4
      - macOS 13.3
      - tvOS 16.4
      - watchOS 9.4
  Android SDK: Not Found
IDEs:
  Android Studio: 2022.2 AI-222.4459.24.2221.10121639
  Xcode:
    version: 14.3.1/14E300c
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 11.0.19
    path: /usr/bin/javac
  Ruby:
    version: 2.7.5
    path: /Users/aitorcubelestorres/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.72.5
    wanted: 0.72.5
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found
Steps to reproduce
  1. Create a new screen with a ScrollView.
  2. Fill it with enough content so that it is scrollable.
  3. Apply some marginTop to the ScrollView, and set overflow: 'visible'.
  4. Scroll down until you reach the end of the ScrollView.
  5. Hold the scroll position: see that the top margin of the ScrollView is shown on top of the content.
Snack, screenshot, or link to a repository

Repository: https://github.com/aitorct/ScrollViewOverflowMargin
Snack: https://snack.expo.dev/@aitorct/scrollviewoverflowmargin

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 bằng cách chạy repository ScrollViewOverflowMargin được liên kết trên Android 12–14 và tái hiện sự cố với overflow: 'visible' và marginTop. So sánh hành vi ở cuối quá trình cuộn với Android 11, sau đó lần theo phần triển khai ScrollView trên Android của React Native. Được xem là hoàn tất khi margin không còn xuất hiện đè lên nội dung ở cuối và hành vi cuộn được báo cáo vẫn được giữ nguyên.

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.