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
I hope this description will show the problem I'm having difficulties to create a codesandbox.
In my vue project including the swiper (core, not vue) I have the problem getting an error message since v8.4.3 when clicking on a linked element in a slide: Uncaught TypeError: swiper.a11y is undefined in a11y.js:195
I have to use the method beforeDestroy() to call swiper.destroy(deleteInstance, cleanStyles) with cleanStyles=false. But if the swiper is destroyed, swiper.a11y.clicked can't be set to false, because it is undefined after destruction.
As a workaround I am setting swiper.a11y = {} after calling swiper.destroy(deleteInstance, cleanStyles).
I suggest adding a check if swiper.destroyed is not true in src/modules/a11y/a11y.js:
No javascript error when swiper is destroyed after clicking a link within a slide.
Actual Behavior
Receiving error message in console after clicking a link within a slide and destroying the swiper: Uncaught TypeError: swiper.a11y is undefined in a11y.js:195
Check that this is really a bug
Reproduction link
no reproduction link
Bug description
I hope this description will show the problem I'm having difficulties to create a codesandbox.
In my vue project including the swiper (core, not vue) I have the problem getting an error message since v8.4.3 when clicking on a linked element in a slide:
Uncaught TypeError: swiper.a11y is undefined in a11y.js:195
I have to use the method
beforeDestroy()
to callswiper.destroy(deleteInstance, cleanStyles)
with cleanStyles=false
. But if the swiper is destroyed,swiper.a11y.clicked
can't be set tofalse
, because it is undefined after destruction.As a workaround I am setting
swiper.a11y = {}
after callingswiper.destroy(deleteInstance, cleanStyles)
.I suggest adding a check if swiper.destroyed is not true in src/modules/a11y/a11y.js:
Expected Behavior
No javascript error when swiper is destroyed after clicking a link within a slide.
Actual Behavior
Receiving error message in console after clicking a link within a slide and destroying the swiper:
Uncaught TypeError: swiper.a11y is undefined in a11y.js:195
Swiper version
8.4.3
Platform/Target and Browser Versions
Windows Chrome 107
Validations
Would you like to open a PR for this bug?
The text was updated successfully, but these errors were encountered: