dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
24.18k stars 3.31k forks source link

PhotoSwipe Default UI 4.1.2 - Dragging outside the window causes multiple errors #1393

Open DanRobinsonRV opened 7 years ago

DanRobinsonRV commented 7 years ago

I've found that the following steps seem to cause a lot of errors in PhotoSwipe in all browsers:

This causes a few errors to pop up:

TypeError: t.getAttribute is not a function (photoswipe-ui-default.js:578:5)

The gallery acts as though the drag was never released. I know it's not an issue with my configuration, as it happens on the documentation example too:

http://photoswipe.com/documentation/getting-started.html

I noticed that the gallery on the main page of your site doesn't seem to have the issue, so I downgraded to that version of PhotoSwipe Default UI (4.1.0) and the issue is no longer occuring, so this must be an issue introduced in a later version of PhotoSwipe Default UI.

Hope this helps.

shobee commented 7 years ago

@dimsemenov Same here. Reproducible on Win 7 / FF 54. With MacOS 10.12.3 / Chrome 59.0.3071.115 it's working fine.

shobee commented 7 years ago

Seems like that bug was introduced with https://github.com/dimsemenov/PhotoSwipe/commit/3fa508e743d01c288ca94be9ca13f66347da2adc#diff-1ac5fbd2e237d8e0d36283b1536af7e8. At least if I change all occurences of getAttribute('class') back to className the bug disappears. Of course this is no solution since obviously these changes were made to fix another bug. No idea how to solve this.

BARNZ commented 4 years ago

Related #1371