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

未关闭 适合新手
#4,002 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@yinminqian 已经在做这个了。

开始于 2026年5月18日。

  • #4003 来自 @yinminqian —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
冷清
技术栈
react-native, typescript
领域
mobile

调研方向

从 src/components/sortableGridList/index.tsx 开始,将其 prop 提取方式和内部 ScrollView 与 src/components/sortableList/index.tsx 进行比较。验证所选 API 会转发 ScrollView 支持的 props(包括 scrollEnabled),且不会覆盖组件自身的样式,并确认报告中的拖拽用例能够正常工作。

由索引模型根据 Issue 内容生成。

描述

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).

主要语言
TypeScript
星标
7.2k
派生
749
平均合并
29 分钟
30 天内合并 PR
1

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wix/react-native-ui-lib 的其他 Issue

查看 wix/react-native-ui-lib 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。