React-native-draggable-flatlist: Android: No Dragging, Item Jumps to Top (RN 0.61.5)

Created on 18 Dec 2019  路  9Comments  路  Source: computerjazz/react-native-draggable-flatlist

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"
},

Most helpful comment

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

All 9 comments

Same issue

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

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

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

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.

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

@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

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ARDcode picture ARDcode  路  9Comments

omarmahili picture omarmahili  路  4Comments

jngcii picture jngcii  路  3Comments

dev-sathish picture dev-sathish  路  7Comments

ButuzGOL picture ButuzGOL  路  8Comments