react-native-draggable-flatlist icon indicating copy to clipboard operation
react-native-draggable-flatlist copied to clipboard

[RN][iOS] - Scroll behaving weirdly when dragging to edge

Open osamaaamer95 opened this issue 5 years ago • 8 comments

Describe the bug Scroll on iOS is behaving weird, I have to gently prod the top and bottom edges of the container to make it work. Android is A-Okay. Here is a gif comparison:

Kapture 2020-04-04 at 0 03 45

Kapture 2020-04-04 at 0 05 31

Code setup in my screen is pretty simple

  return (
    <View style={{ flex: 1 }}>
      <View style={{ flexDirection: "row", flexWrap: "wrap", justifyContent: "center" }}>
        <Text text={"Title:"} style={{ color: color.black, marginRight: spacing[1] }} />
        {categoryArray
          .slice(0, ITEMS_ALLOWED)
          .map(
            (item, i) =>
              item.isSelected && (
                <Text
                  text={`${item.label}${i + 1 < ITEMS_ALLOWED ? "," : ""}`}
                  style={{ color: color.palette.lightGrey, marginRight: spacing[1] }}
                />
              ),
          )}
      </View>
      <View style={{ flex: 1 }}>
        <DraggableFlatList
          data={categoryArray}
          renderItem={renderItem}
          keyExtractor={(item, index) => `draggable-item-${index}`}
          onDragEnd={({ data }) => setArray(data)}
        />
      </View>
    </View>
  )

To Reproduce I have not tested this on a barebones app, but there is nothing extraordinary in my setup.

Platform & Dependencies Please list any applicable dependencies in addition to those below (react-navigation etc).

  • Platform: RN iOS
  • React Native or Expo version: 0.62
  • Reanimated version: 1.7.0
  • React Native Gesture Handler version: 1.5.0

osamaaamer95 avatar Apr 03 '20 19:04 osamaaamer95

I'm experiencing the same issue with Expo SDK 37.

dperrera avatar Apr 14 '20 21:04 dperrera

Same issue here. That happens to me when scrollTop is equal to one of the edges (start of list: scrollTop=0 or end of list: scrollTop=listHeight-containerHeight). if I scroll a little bit (eq. scrollTop=100), I can scroll to the edges and it works :/

ezgif com-video-to-gif (1)

@computerjazz does this ring a bell?

emroot avatar Apr 29 '20 07:04 emroot

I am with the same problem. Just on iOS. Android works fine.

"react-native": "0.62.2",
"react-native-draggable-flatlist": "^2.3.3",

@computerjazz Is there something we can do about this?

nelsonprsousa avatar Jun 13 '20 17:06 nelsonprsousa

I just updated my app to Expo 38 and that seemed to fix the problem. I'm guessing it was a fix in a downstream dependency.

dperrera avatar Jun 28 '20 21:06 dperrera

We're using React Native CLI (0.62.2, last version), not using Expo, and we still got this problem. Without a solution for now 😞

nelsonprsousa avatar Jun 28 '20 22:06 nelsonprsousa

@nelsonprsousa Have you upgraded reanimated to the latest version? That might be worth a shot.

dperrera avatar Jun 28 '20 22:06 dperrera

@nelsonprsousa Have you upgraded reanimated to the latest version? That might be worth a shot.

I am using react-native-reanimated@^1.9.0. I am assuming I shouldn't use version 2 (still on alpha with breaking changes).

Tomorrow I'll push a repository to reproduce the problem 👍

nelsonprsousa avatar Jul 07 '20 22:07 nelsonprsousa

@nelsonprsousa @computerjazz I just ran into the same problem on iOS only and it is definitely fixed for me after updating possibly involved libraries:

  • RN-Draggable-Flatlist 2.3.3 --> 2.4.0
  • RN-Gesture-Handler to 1.6.1 --> 1.8.0
  • RN-Reanimated to 1.9 --> 1.13.1
  • RN-Screens to 2.8 --> 2.11.0 (not sure if related)
  • RN-Safe-Area-Context to 3.0.8 --> 3.1.8 (not sure if related)

Works fine now, tested in normal DND Flatlists and DND Flatlists inside a Keyboard-Aware-Scroll-View (APSL).

creambyemute avatar Oct 06 '20 18:10 creambyemute