SortableGridList does not forward props to its inner ScrollView (inconsistent with SortableList)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 7.2k
- Forks
- 748
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 1
Description
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).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/components/sortableGridList/index.tsx and compare its prop extraction and inner ScrollView with src/components/sortableList/index.tsx. Verify the chosen API forwards supported ScrollView props, including scrollEnabled, without overriding the component's own styles, and confirm the reported drag use case works.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100