You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When clicking IN the swiper-slide content, the slideToClickedSlide doesn't work.
In the reproduction link, when clicking on the numbers text, nothing happens, but if I click on the space surrounding it inside it's border, then the slideToClickedSlide trigger.
From what I can understand, Swiper use the closest method on the target of the click, to get the closest swiper-slide, to which it will slide to. But when clicking on the content of the slot, then the target is inside the shadow DOM, and closest return nothing (but when clicking on the white space around it, then we click outside the shadow DOM).
Expected Behavior
slideToClickedSlide trigger when clicking on the content of the swiper-slide.
Actual Behavior
slideToClickedSlide does NOT trigger when clicking on the content of the swiper-slide (only work when clicking ou the space around, NOT in the shadow DOM).
Check that this is really a bug
Reproduction link
https://stackblitz.com/edit/vue3-script-setup-with-vite-siqjxo?file=src%2Fcomponents%2FAgeSelector.vue
Bug description
When clicking IN the swiper-slide content, the slideToClickedSlide doesn't work.
In the reproduction link, when clicking on the numbers text, nothing happens, but if I click on the space surrounding it inside it's border, then the slideToClickedSlide trigger.
From what I can understand, Swiper use the
closest
method on the target of the click, to get the closest swiper-slide, to which it will slide to. But when clicking on the content of the slot, then the target is inside the shadow DOM, andclosest
return nothing (but when clicking on the white space around it, then we click outside the shadow DOM).Expected Behavior
slideToClickedSlide trigger when clicking on the content of the swiper-slide.
Actual Behavior
slideToClickedSlide does NOT trigger when clicking on the content of the swiper-slide (only work when clicking ou the space around, NOT in the shadow DOM).
Swiper version
10.1.0
Platform/Target and Browser Versions
Firefox
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: