Skip to content

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

@yinminqian

Description

@yinminqian

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions