mozilla / addons

☂ Umbrella repository for Mozilla Addons ✨
Other
127 stars 41 forks source link

Screenshots preview is not working for second add-on #10077

Closed ValentinaPC closed 7 years ago

ValentinaPC commented 7 years ago

Steps to reproduce:

  1. Open AMO-dev on your Android device
  2. Load details page for an add-on
  3. Navigate through screenshots in full mode preview
  4. Go to another add-on details and try to navigate to its screenshots in full mode preview

Expected results: User can navigate through screenshots in full mode preview with not problems.

Actual results: Screenshots section turns into with for the second add-on. Screenshot cannot longer be previewed.

Notes/Issues: Verified on AMO-dev FF51(Android 6.0.1). Video for this issue: noscrrn

muffinresearch commented 7 years ago

Cause is TypeError we just need to work out the specific line triggering it.

tofumatt commented 7 years ago

"thumbnail" is not defined

The bug is in this line of code:

            options.getThumbBoundsFn = options.getThumbBoundsFn || function (index) {
              var thumbnail = _reactDom2['default'].findDOMNode(_this.refs['thumbnail' + index]);
              var img = thumbnail.getElementsByTagName('img')[0];
              var pageYScroll = window.pageYOffset || document.documentElement.scrollTop;
              var rect = img.getBoundingClientRect();
              return { x: rect.left, y: rect.top + pageYScroll, w: rect.width };
            };

in the PhotoSwipeGallery component.

ValentinaPC commented 7 years ago

Verified as fixed on AMO-dev FF51(Android 6.0.1) Postfix video: videotogif_2017 03 07_09 51 25