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
We are trying to use a Swiper for dynamic slider with settings that are changing dynamically (in our case show/hide navigation arrows if user clicks a button/tougle).
So we are adding and removing Swiper attribute "navigation"="true".
It works well to add the navigation on button click (navigation arrow buttons appears and are working well).
But it is not working well when we are removing the "navigation"="true" attribute - navigation is not removed.
Even if we are destroying navigation via code swiper.navigation.destroy() - navigation arrow buttons are not clickable but still remain in shadow DOM as visible elements.
Also after swiper.navigation.destroy() we need to manually do swiper.navigation.init() as without it adding "navigation"="true" again is not working. Is it smth expected for a Swiper?
Check that this is really a bug
Reproduction link
https://codesandbox.io/p/sandbox/swiper-manipulation-forked-zo75it?file=%2Findex.html%3A98%2C14
Bug description
We are trying to use a Swiper for dynamic slider with settings that are changing dynamically (in our case show/hide navigation arrows if user clicks a button/tougle).
So we are adding and removing Swiper attribute
"navigation"="true"
.It works well to add the navigation on button click (navigation arrow buttons appears and are working well).
But it is not working well when we are removing the
"navigation"="true"
attribute - navigation is not removed.Even if we are destroying navigation via code
swiper.navigation.destroy()
- navigation arrow buttons are not clickable but still remain in shadow DOM as visible elements.Here in Navigation module code need to clean up shadow dom elements on destroy:
https://github.com/nolimits4web/swiper/blob/master/src/modules/navigation/navigation.js#L126
Also after
swiper.navigation.destroy()
we need to manually doswiper.navigation.init()
as without it adding"navigation"="true"
again is not working. Is it smth expected for a Swiper?Also looks like same issue is present for a pagination module (leftover shadow DOM elements):
see https://github.com/nolimits4web/swiper/blob/master/src/modules/pagination/pagination.js#L394
Expected Behavior
After removing Swiper attribute
"navigation"="true"
(or setting it to false) - navigation arrow buttons are removed from shadow DOM.Actual Behavior
After removing Swiper attribute
"navigation"="true"
(or setting it to false) - there are leftover Shadow DOM elements for arrow buttons.Swiper version
9
Platform/Target and Browser Versions
All
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: