-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple slides per view - Clicking links on mobile (or right click/scroll wheel click on desktop) jumps the clicked element to first position instead of opening the link #5814
Comments
I have been debugging the same thing all morning now. I have 3 slides in view, without centeredSlides, so the left one is the main one. Clicks on the left one will work (opening a modal). Clicks on slide 2 and 3 will make those slides jump to the left, as the main slide. Even tho mouse click sliding also makes the slide jump to position 1 before sliding on mouseUp by the way. |
Hi everyone, I have the same issue. |
+1 |
add target="_blank" in the inside of your a tag to open a new tab |
"or right clicking/scroll wheel clicking an slide, jumps the clicked slide to the first position instead of opening the link." seems to be related with: #5625 |
Thanks @nolimits4web , just tested in and fixes the bug! Much appreciated |
This is still an issue on mobile/touch devices in version 8.4.2 |
I have a solution that mobile touch on ui elements like links or select fields no longer makes the slide jump to first place. Touch events also trigger a focus event. I added a condition to check that the focus event was not triggered by touch. |
Check that this is really a bug
Reproduction link
https://codepen.io/Ionut2022/pen/rNJEOgx
Bug description
In sliders with mutliple elements visible that contain a link, clicking on a slide on a mobile device (simulating touch with browser DevTools also works - refresh page after resizing the window), or right clicking/scroll wheel clicking an slide, jumps the clicked slide to the first position instead of opening the link.
The link opens correctly only when the slider is at the last slide, or clicking the first slide of the current view.
Edit: The problem appeared since version 8.0.0
Version 7.4.1 is the last version that works correctly: https://codepen.io/Ionut2022/pen/ZErdJEb
Expected Behavior
Clicking a slide that contains a link on a mobile device opens the link.
On desktop, scroll wheel clicking on a slide with a link, opens the link in new tab.
Actual Behavior
Clicking a slide with a link on a mobile device (other then the first slide in the current view), jumps the clicked slide to the first position and does not open the link.
Scroll wheel clicking a slide with a link, does not open the link and jumps the clicked slide to the first position.
Swiper version
8.2.4
Platform/Target and Browser Versions
Android Chrome / Windows Chrome
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: