deanmcpherson / react-native-sortable-listview

Drag drop capable wrapper of ListView for React Native
MIT License
917 stars 235 forks source link

Undefined is not an object (evaluating 'wrapperLayout.pageY')) #134

Open brunoczo opened 6 years ago

brunoczo commented 6 years ago

unnamed 1

I'm getting this error in IOS, does anyone know what it can be? No Android is working properly.

Edit: My workaround is edit the node_modules/react-native-sortable-listview/index.js and add the (wrapperLaoyout==null?0:wrapperLaoyout.pageY) in 3 pointis of my code

aidan-doherty commented 6 years ago

I also get this error on ios seems to happen when the drag is not completed properly.

aidan-doherty commented 6 years ago

hard to replicate in ios simulator but happens on iphone 6 device seems the scrolling on the list and drag is conflicting @brunoczo your workaround does fix the error page displaying but it never retrieves the correct scroll offset with wrapperLayout as it is always set to 0.

zbz1366 commented 6 years ago

I have the save prolem , how to solve this prolem ?

adamjacob commented 6 years ago

Anyone successfully fix this? Facing this same issue

nihgwu commented 6 years ago

I will check if I can fix that this week

adamjacob commented 6 years ago

Commenting out the InteractionManager here (https://github.com/deanmcpherson/react-native-sortable-listview/blob/master/index.js#L458-L460) fix it for me. Not sure if it's something that I'm doing in my application but InteractionManager.runAfterInteractions was never triggering so the layout was never getting measured.

kasajei commented 6 years ago

@adamjacob You mean

componentDidMount() {
    // InteractionManager.runAfterInteractions(() => {
      this.timer = setTimeout(() => this && this.measureWrapper(), 0)
    // })
  }

Right? For me, it also work. Thank you.

LucasYver commented 5 years ago

I have this issue only on android

this.refs.wrapper.measure

Always return undefined...