Skip to content
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

bug: Swiper params is null/undefined after slides are cleared #22289

Closed
kensodemann opened this issue Oct 9, 2020 · 3 comments · Fixed by #23239
Closed

bug: Swiper params is null/undefined after slides are cleared #22289

kensodemann opened this issue Oct 9, 2020 · 3 comments · Fixed by #23239

Comments

@kensodemann
Copy link
Member

kensodemann commented Oct 9, 2020

Bug Report

Ionic version:

[ ] 4.x
[x] 5.x

Current behavior:
Application displays slides in swiper. Upon the action of changing the zip code to change clubs, the slides are cleared, and recreated. At that time, the following errors appear in the console.log:

Screen Shot 2020-10-09 at 4 58 11 PM

Working on narrowing down a reproduction case.

Expected behavior:
There would not be an error in the console.

Steps to reproduce:
In a sample APK that we have for another issue, open the app and connect the dev tools then use the login page to toggle between the two following zip codes:

  • 18444
  • 43085

You will see the error in the console log when you do this

@ionitron-bot ionitron-bot bot added the triage label Oct 9, 2020
@kensodemann
Copy link
Member Author

Spoke with the user having this issue. They are currently patching Ionic as such:

     async optionsChanged() {
         if (this.swiperReady) {
             const swiper = await this.getSwiper();
-            Object.assign(swiper.params, this.options);
-            await this.update();
+            if (swiper && swiper.params) {
+              Object.assign(swiper.params, this.options);
+              await this.update();
+            }
         }
     }

Just in several places because they are applying this to the dist output...

@liamdebeasi
Copy link
Contributor

Resolved via #23239.

@ionitron-bot
Copy link

ionitron-bot bot commented May 26, 2021

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators May 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants