SortableGridList does not forward props to its inner ScrollView (inconsistent with SortableList)

Đang mở Phù hợp với người mới
#4,002 0 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 1 ngày

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

Từ ngày 18/5/2026.

  • #4003 của @yinminqian — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
react-native, typescript
Lĩnh vực
mobile

Hướng nghiên cứu

Bắt đầu trong src/components/sortableGridList/index.tsx và so sánh việc trích xuất prop cùng ScrollView bên trong với src/components/sortableList/index.tsx. Xác minh API được chọn chuyển tiếp các prop được ScrollView hỗ trợ, bao gồm scrollEnabled, mà không ghi đè các style riêng của component, và xác nhận trường hợp sử dụng thao tác kéo được báo cáo hoạt động.

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

Mô tả

Description

SortableGridList renders an inner <ScrollView> but does not forward any extra props to it, making it impossible to set props like scrollEnabled, alwaysBounceVertical, showsVerticalScrollIndicator, keyboardShouldPersistTaps, etc. without patching.

This is inconsistent with SortableList, which does spread {...others} onto its internal FlatList:

```js
// src/components/sortableList/index.tsx (9.0.0)
<FlatList {...others} ref={listRef} horizontal={horizontal} data={data} ... />
```

But SortableGridList does not:

```js
// src/components/sortableGridList/index.tsx (9.0.0)
<ScrollView style={listStyle} contentContainerStyle={[styles.listContent, listContentStyle, listColumnWrapperStyle]}>
```

Real-world use case

A short, one-screen "reorder home cards" page where the list fits without scrolling. Enabling scroll causes the inner `ScrollView`'s scroll gesture to compete with the long-press-drag gesture used by `SortableItem`, making drag near the edge unreliable. The expected solution is to pass `scrollEnabled: false` to the inner `ScrollView`. There is currently no API to do this.

We currently maintain a `patch-package` patch against 7.x and confirmed it is still required in 9.0.0:

```diff
const {
itemSpacing = DEFAULT_ITEM_SPACINGS,

  • data
  • data,
  • scrollViewProps = {}
    } = others;
    ...
  • <ScrollView contentContainerStyle={[styles.listContent, listContentStyle]}>
  • <ScrollView contentContainerStyle={[styles.listContent, listContentStyle]} {...scrollViewProps}>
    ```
Suggested fix

Either:

  • (preferred, matches `SortableList`) Spread `{...others}` onto the inner `ScrollView`, after extracting the props `SortableGridList` itself consumes.
  • Or add a dedicated `scrollViewProps?: ScrollViewProps` prop on `SortableGridListProps`.

Happy to open a PR if the maintainers indicate a preferred approach.

Affected versions

At least 7.12.0 → 9.0.0 (latest at time of writing).

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

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

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 wix/react-native-ui-lib

Tất cả issue của wix/react-native-ui-lib

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.