Swiper: onTouchMove() called on pointermove event

Created on 15 Feb 2021  路  8Comments  路  Source: nolimits4web/swiper

  • Swiper Version: 6.4.11

    • Platform/Target and Browser Versions: Win10, Chrome 88.0.4324.150

What You Did

Having a trouble with performance using an angular version of swiper. I'm not trying to implement some specific stuff behaviour of swiper, just simple <swiper>...some slides....</swiper> thats what i need.

Given: 15 swiper components per page, each of them may have 20-40 slides.

At some point i have noticed that page just not respond at all, i have noticed that console spams me with messages like that
[Violation] 'pointermove' handler took <N>ms
So it obviously why page freezes. After little investigation i have found that origin of this are method onTouchMove which are called on each move of mouse AND for each swiper instance. Once pointermove event fired by browser - it makes 15 calls of this method.

You can see some sample below, it does not produce such big problems as it very simple example. But you may open task manager of chrome and you will see what impact to CPU when you move mouse. So accounting this simple case you can imagine how it looks at site where swiper are just a little part.

https://stackblitz.com/edit/pointermove-issue

Expected Behavior

onTouchMove() should be called when it touch and then move, not just move

Actual Behavior

So it simple, just any move raises execution of onTouchMove()

Angular has demo

Most helpful comment

Will do tomorrow

All 8 comments

@vltansky wondering will it be fixed with your PR #4197 (which is not released yet)?

@nolimits4web pretty sure that yes

Can we make a release?

Will do tomorrow

Thank you very much for fast reaction, hope soon release will solve an issue

Just released 6.4.12, can you check if it is fixed there?

Yeah! Site are working much more better now! at least part with swiper does not make a troubles.

Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

QJan84 picture QJan84  路  3Comments

Uriziel01 picture Uriziel01  路  3Comments

callumacrae picture callumacrae  路  3Comments

leone510es picture leone510es  路  3Comments

voodoo6 picture voodoo6  路  3Comments