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

Android: No Dragging, Item Jumps to Top (RN 0.61.5)

Open chriszwickerocteris opened this issue 6 years ago • 9 comments

See video: Screen-Recording-2019-12-18-at-13 48 44

Repro

  • npx react-native init XXX --template react-native-template-typescript
  • Install peer dependencies
  • Replace content of App.tsx with example code from readme
  • Run on Android

Package: Dependencies

"dependencies": { "react": "16.9.0", "react-native": "0.61.5", "react-native-draggable-flatlist": "^2.0.10", "react-native-gesture-handler": "^1.5.2", "react-native-reanimated": "^1.4.0" },

chriszwickerocteris avatar Dec 18 '19 13:12 chriszwickerocteris

Same issue

DenisSokoloff avatar Dec 20 '19 09:12 DenisSokoloff

Have you followed the extra setup instructions for rngh in MainActivity? It's not 100% autolinked... https://software-mansion.github.io/react-native-gesture-handler/docs/getting-started.html

computerjazz avatar Dec 20 '19 17:12 computerjazz

I had the same issue, but following guide on proper installing react-native-gesture-handler mentioned by computerjazz solved this for me. https://software-mansion.github.io/react-native-gesture-handler/docs/getting-started.html

5ur3 avatar Dec 31 '19 14:12 5ur3

@chriszwickerocteris did you try the above solution? Can we close this?

computerjazz avatar Jan 07 '20 19:01 computerjazz

Indeed, that solves it, thanks - and sorry, hadn't had the time to review before!

I would suggest documenting this in the installation steps section of the README, though. In times of autolinking, I may not be the only one not checking peer dependencies' docs.

chriszwickerocteris avatar Jan 08 '20 19:01 chriszwickerocteris

@computerjazz hi I see this behaviour when the component is presented inside Modal. Once it is presented in regular view everything works as expected so I guess it's not installation issue. Is there any known issue related to Modal ? I didn't find anything

anyway, for now my workaround is to simulate Modal behaviour using regular view.

tamirla avatar Jan 22 '20 10:01 tamirla

@computerjazz hi I see this behaviour when the component is presented inside Modal. Once it is presented in regular view everything works as expected so I guess it's not installation issue. Is there any known issue related to Modal ? I didn't find anything

anyway, for now my workaround is to simulate Modal behaviour using regular view.

the same, reproduced on Android only I'm using react-navigation

Shedav avatar Jan 27 '20 21:01 Shedav

I can also confirm it does not work as expected inside a Modal

juanjsebgarcia avatar Feb 24 '20 19:02 juanjsebgarcia

Hey guys, I've found the solution to getting it to work inside a modal. Just wrap the Component you want to use as the modal inside gestureHandlerRootHOC. Example:

import {gestureHandlerRootHOC} from 'react-native-gesture-handler';

const MyModalComponent = (props) => {
    return (<View> .... </View>)
}

export default gestureHandlerRootHOC(MyModalComponent)

This got it working like a charm for me. :)

prathammehta avatar Apr 02 '20 13:04 prathammehta