Swiper breaks on iOS10 safari with s.params is not an object (onTouchStart)
See original GitHub issueThis is a (multiple allowed):
-
bug
-
enhancement
-
feature-discussion (RFC)
-
Swiper Version: EXACT RELEASE VERSION OR COMMIT HASH, HERE. 3.4.1
-
Platform/Target and Browser Versions: PLATFORM CLIENT YOU ARE TARGETING SUCH AS macOS, Windows, CORDOVA, IOS, ANDROID, CHROME, ETC. IOS10 Safari
What you did
EXPLAIN WHAT YOU DID, PREFERABLY WITH CODE EXAMPLES, HERE.
TouchStart event shits the bed with (s.params is not an object)
Expected Behavior
EXPLAIN WHAT IS TO BE EXPECTED, HERE.
Not to shit the bed.
Actual Behavior
EXPLAIN WHAT IS ACTUALLY HAPPENING, HERE.
swiper.js line 1533 defines
s.onTouchStart = function (e) { ... }
the first touch event on iOS safari, s is null, so line 1538 throws an error.
if (s.params.noSwiping && findElementInEvent(e, '.' + s.params.noSwipingClass)) { ... }
if I modify the onTouchStart handler as such, it doesn’t break - but not sure what the impact is.
s.onTouchStart = function (e) { if (!s) return; ... }
The touchStart event appears to fire twice (at least on the first touch) first time s === null second time s === swiper instance.
P.S. Remember, an issue is not the place to ask questions. You can use Stack Overflow for that.
Before you open an issue, please check if a similar issue already exists or has been closed before.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:9 (7 by maintainers)
The ngx-swiper-wrapper is calling the destroy and thats why the bug exists when using that library. @nolimits4web would you like me to make new issue or even look into making PR for this? So the bug is definitely in the destroy not removing some event listener.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.