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

Abierto Apto para principiantes
#4,002 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

@yinminqian ya está trabajando en esto.

Desde el 18/5/2026.

  • #4003 de @yinminqian — abierto

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
78/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Tranquilo
Stack tecnológico
react-native, typescript
Área
mobile

Línea de trabajo

Comienza en src/components/sortableGridList/index.tsx y compara la extracción de props y el ScrollView interno con src/components/sortableList/index.tsx. Verifica que la API elegida reenvíe las props compatibles de ScrollView, incluido scrollEnabled, sin sobrescribir los estilos propios del componente, y confirma que el caso de uso de arrastre reportado funciona.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
7.2k
Forks
749
Merge medio
29 min
PR fusionados (30 d)
1

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de wix/react-native-ui-lib

Todos los issues de wix/react-native-ui-lib

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.