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

ionic2 - <ion-slide> is not removed when *ngIf evaluates to false #6651

Closed
zakton5 opened this issue May 25, 2016 · 2 comments
Closed

ionic2 - <ion-slide> is not removed when *ngIf evaluates to false #6651

zakton5 opened this issue May 25, 2016 · 2 comments
Assignees
Milestone

Comments

@zakton5
Copy link
Contributor

zakton5 commented May 25, 2016

Short description of the problem:

When optionally showing a slide by using *ngIf, the slide is correctly shown and the pager is updated with the correct amount of bullets when it evaluates to true. However, after the *ngIf evaluates to false, the slide and the pager bullet are still visible, but the slide content disappears.

What behavior are you expecting?

I expect the ion-slide to be removed from the DOM and the corresponding pagination-bullet to be removed from the pager when *ngIf evaluates to false.

Which Ionic Version? 2.x beta.7

Plunker that shows an example of your issue

https://plnkr.co/edit/FY3wMgtoW7yvdVvSD6pa?p=preview

Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-beta.7
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
ios-deploy version: 1.8.4
ios-sim version: 5.0.6
OS: Mac OS X El Capitan
Node Version: v4.4.4
Xcode version: Xcode 7.3 Build version 7D175

@zakton5
Copy link
Contributor Author

zakton5 commented May 25, 2016

After digging into it a little further, I've found that the Slide class calls rapidUpdate() in its constructor on line 910, which then notifies the swiper-widget that the slides have changed. It would make sense to simply call that function again in the Slide's ngOnDestroy() function. I'll work on a PR.

@brandyscarney
Copy link
Member

Fixed by #6655, thank you again. 😄

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants