react / react/react-native

Section sticky header in wrong place after list header change until scroll

Đang mở
#50,189 12 bình luận 1 reaction 0 người được giao Xem trên GitHub

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

Issue: Author Provided Repro Type: New Architecture
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

I migrating to the New Architecture.
I have component which worked fine 7 years on the "old architecture".
It uses Animated.SectionList and can hide content in ListHeaderComponent.
In the New architecture on ListHeaderComponent change: section header (renderSectionHeader) goes to the wrong place until manually scroll a little.

Steps to reproduce
  1. Clone and run https://github.com/Bardiamist/diff/tree/section-list-header

  2. Scroll util red header will stick

  3. Press Hide top content after 1 sec button

  4. Wait 1 second
    Expected result: red header should be in same place

  5. Scroll a little

  6. Press Show content after 1 sec button

  7. Wait 1 second
    Expected result: red header should be in same place

React Native Version

0.78.1

Affected Platforms

Runtime - iOS

Areas

Fabric - The New Renderer

Output of npx @react-native-community/cli info
System:
  OS: macOS 15.3.2
  CPU: (10) arm64 Apple M1 Max
  Memory: 11.71 GB / 64.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 23.10.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 1.22.22
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.9.2
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2025.03.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.12.1
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 24.2
      - iOS 18.2
      - macOS 15.2
      - tvOS 18.2
      - visionOS 2.2
      - watchOS 11.2
  Android SDK: Not Found
IDEs:
  Android Studio: 2024.3 AI-243.22562.218.2431.13114758
  Xcode:
    version: 16.2/16C5032a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.14
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /Users/bardiamist/.rbenv/shims/ruby
npmPackages:
  "@react-native-community/cli":
    installed: 15.0.1
    wanted: 15.0.1
  react:
    installed: 19.0.0
    wanted: 19.0.0
  react-native:
    installed: 0.78.1
    wanted: 0.78.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true
Stacktrace or Logs
No crash
Reproducer

https://github.com/Bardiamist/diff/tree/section-list-header

Screenshots and Videos

Works with problem on the New Architecture:

https://github.com/user-attachments/assets/ceef7a7d-3e8e-49c9-83ba-2c402c8ce269

Worked as expected on the "old architecture":

https://github.com/user-attachments/assets/ea9ac31c-c424-494c-9a89-1e09b08b220c

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

Chạy reproducer section-list-header được liên kết trên iOS với New Architecture được bật, sau đó kiểm tra hành vi của Animated.SectionList và renderSectionHeader khi nội dung của ListHeaderComponent bị ẩn hoặc được hiển thị. Được xem là hoàn tất khi header của section màu đỏ vẫn ở cùng vị trí sau cả hai thay đổi mà không cần cuộn thủ công.

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
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
42/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.