Cannot disable body auto-scroll when changing slides while swiper is out of viewport
kelvin2200 opened this issue · comments
Check that this is really a bug
- I confirm
Reproduction link
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
- Follow our Code of Conduct
- Read the docs.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
- Make sure this is a Swiper issue and not a framework-specific issue
Would you like to open a PR for this bug?
- I'm willing to open a PR