nolimits4web / swiper

Most modern mobile touch slider with hardware accelerated transitions
https://swiperjs.com
MIT License
39.91k stars 9.75k forks source link

Cannot disable body auto-scroll when changing slides while swiper is out of viewport #7525

Closed kelvin2200 closed 6 months ago

kelvin2200 commented 6 months ago

Check that this is really a bug

Reproduction link

https://nolink

Bug description

I have 2 swipers, one on top of the other, and they are connected. Navigating in one, also changes the slide in the second. The first swiper is full-height, making the second to not be in the viewport. If I scroll the page to the second swiper and navigate to next/prev slide, the body automatically scrolls to the either the top, or the position where the first slider is.

And NO, the navigation buttons don't have any hash nor link attached to them.

How can I prevent this from happening?

Note: I am using Wordpress and elementor's carousel widgets + jQuery to achieve this functionality, and swiper tampering is fairly limited. Even so, if there is some sort of option I can disable, please let me know.

Expected Behavior

(body/page) scroll position to be preserved when changing slides.

Actual Behavior

Page is scrolling to top.

Swiper version

8.4.5

Platform/Target and Browser Versions

all

Validations

Would you like to open a PR for this bug?

nolimits4web commented 6 months ago

https://nolink/