react-native-gallery icon indicating copy to clipboard operation
react-native-gallery copied to clipboard

Error cannot read property "onResponderGrant" of undefined

Open admc opened this issue 8 years ago • 6 comments

First image in gallery displays correctly, clicking on it yields the following, tried older versions, and different images, wrapping it in a View, etc and nothing seems to make a difference. Any ideas?

screen shot 2016-07-11 at 9 15 38 pm
"react": "^15.2.1",
"react-native": "^0.29.0",
"react-native-gallery": "0.0.15",

render() { return (
<Gallery style={{flex: 1, backgroundColor: 'black'}} images={[ 'http://p10.qhimg.com/t019e9cf51692f735be.jpg', 'http://ww2.sinaimg.cn/mw690/714a59a7tw1dxqkkg0cwlj.jpg', 'http://www.bz55.com/uploads/allimg/150122/139-150122145421.jpg' ]} /> ) } }

admc avatar Jul 12 '16 07:07 admc

@admc Sorry to say that I cannot reproduce the error above with same react-native version. But this could be a similar problem with the one mentioned in the pull request. Pls try editting your Gallery.js in your node_modules folder (follow the pull request, just some lines changed) and see if it works.

ldn0x7dc avatar Jul 12 '16 07:07 ldn0x7dc

It did render more of a matrix of images, however I still receive the same error unfortunately. I wish I knew better how to help debug this issue :(

admc avatar Jul 12 '16 23:07 admc

@admc I'm looking into it. Problem is I can not reproduce this error, so it's troublesome. If you are not testing using the Demo project, maybe you could post more code here. It may help~

ldn0x7dc avatar Jul 13 '16 01:07 ldn0x7dc

I am having the same issue

nickrobinson352 avatar Jan 07 '17 16:01 nickrobinson352

The issue appears only on Android if the Gallery has more than 50 images, setting initialPage to > 11 will always lead to show the image #11 and scrolling will crash the all with the following error:

undefined is not an object (evaluating '_this2.getCurrentImageTransformer().onResponderGrant')
onStart
    Gallery.js:112
activeImageResponder
    Gallery.js:146
onResponderGrant
    Gallery.js:61
onResponderGrant
    createResponder.js:189
executeDirectDispatch
    EventPluginUtils.js:176
setResponderAndExtractTransfer
    ResponderEventPlugin.js:344
extractEvents
    ResponderEventPlugin.js:444
extractEvents
    EventPluginHub.js:196
handleTopLevel
    ReactEventEmitterMixin.js:28
<unknown>
    ReactNativeEventEmitter.js:125
perform
    Transaction.js:138
batchedUpdates
    ReactDefaultBatchingStrategy.js:63
batchedUpdates
    ReactUpdates.js:98
_receiveRootNodeIDEvent
    ReactNativeEventEmitter.js:124
receiveTouches
    ReactNativeEventEmitter.js:186
__callFunction
    MessageQueue.js:228
<unknown>
    MessageQueue.js:105
guard
    MessageQueue.js:44
callFunctionReturnFlushedQueue
    MessageQueue.js:104

mjebrini avatar Feb 10 '17 21:02 mjebrini

Got to find a solution for this:

This is related to a bug in the ListView in ViewPager where ListView initialListSize={initialListSize} should be set to the number of images in your Gallery.

check here for full solution

mjebrini avatar Feb 11 '17 04:02 mjebrini