Skip to content

items sometimes get "stuck" when dragging #349

@rkstar

Description

@rkstar

sometimes, inconsistently, when dragging an item it will get "stuck" in drag mode. it doesn't happen all the time, and it may only be happening on specific devices (?) -- i've only seen this reproduced on iphone 15 pro. it does not seem to happen on iphone 13 pro or samsung s23 devices.

everything else works fantastically: auto-scroll, enable/disable sorting, multi-column, etc... even the pagination and pull-to-refresh works great when wrapped Sortable.Grid in Animated.FlatList.

i don't think i'm doing anything special or outrageous, so i'm unsure why this would be happening. changing the data input or disable/enable sort seems to "reset" the drag state. here's the code i'm using:

  const ref = useAnimatedRef<Animated.FlatList<T>>();
  const overDrag: OverDrag = (props.columns ?? 0) >= 2 ? 'both' : 'vertical';
  const onOrderChange = () => Haptics.impactAsync(Haptics.ImpactFeedbackStyle.Light);

  const onDragEnd = ({
    sortedItem,
    sortedAfterItem,
    version,
  }: DragAndDropListDragEndParams<TodoListItemDataFragment>) => {
    // api call ... 
    handleEditListCustomSortOrder({ sortedItem, sortedAfterItem, version });
  };

  const renderItem = React.useCallback(
    ({ item }) => (
      <ListItem
        showListName
        item={item}
        listId={item.listId}
        listType={ListTypeEnum.TaskList}
        onRefresh={onRefresh}
      />
    ),
    [],
  );


  return (
    <Animated.FlatList
      ref={ref}
      data={[1]}
      refreshing={refreshing}
      onRefresh={onRefresh}
      keyboardDismissMode="on-drag"
      renderItem={() => (
        <Sortable.Grid<T>
          scrollableRef={ref}
          data={data}
          renderItem={renderItem}
          activeItemScale={1.05}
          inactiveItemOpacity={0.85}
          dragActivationDelay={600}
          overDrag={overDrag}
          onDragEnd={onDragEnd}
          onOrderChange={onOrderChange}
          rows={undefined}
        />
      )}
    />
  );

here's an example of it happening:

ScreenRecording_04-10-2025.07-33-59_1.MP4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions