minhtranite / react-photoswipe

PhotoSwipe, PhotoSwipeGallery component for ReactJS base on PhotoSwipe.
322 stars 106 forks source link

Cannot read property 'getElementsByTagName' of null #23

Open GZWZC opened 7 years ago

GZWZC commented 7 years ago

i have two page, page1:index page2:detailsIndex

the photoswipe is used to the page2, when i enter the page2, click the pic once,console.info "Uncaught TypeError: Cannot read property 'getElementsByTagName' of null at Object.options.getThumbBoundsFn (bundle.js:60723) at PhotoSwipe. (bundle.js:59004) at _shout (bundle.js:56486) at PhotoSwipe.init (bundle.js:56944) at PhotoSwipe. (bundle.js:55915) at CallbackQueue.notifyAll (bundle.js:14049) at ReactUpdatesFlushTransaction.close (bundle.js:13776) at ReactUpdatesFlushTransaction.closeAll (bundle.js:15234) at ReactUpdatesFlushTransaction.perform (bundle.js:15181) at ReactUpdatesFlushTransaction.perform (bundle.js:13806)"

click the pic twice , no response click the pic three times , the dom is clear:

before:<div class="pswp-thumbnails"><div class="pswp-thumbnail"><img /></div></div>

after:<div class="pswp-thumbnails"></div>