ionic-team / ionic-framework

A powerful cross-platform UI toolkit for building native-quality iOS, Android, and Progressive Web Apps with HTML, CSS, and JavaScript.
https://ionicframework.com
MIT License
51.1k stars 13.51k forks source link

[V4]Ion slides do not update well with dynamic content #15761

Closed Tochukwuibe closed 5 years ago

Tochukwuibe commented 6 years ago

Bug Report

Ionic Info Run ionic info from a terminal/cmd prompt and paste the output below.

√ Gathering environment info - done!

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (C:\Users\Toch\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.11
   @angular-devkit/core       : 0.7.5
   @angular-devkit/schematics : 0.7.5
   @angular/cli               : 6.1.5
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : not installed
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:

   NodeJS : v8.11.1 (C:\Program Files\nodejs\node.exe)
   npm    : 6.0.0
   OS     : Windows 10

Describe the Bug I have a page with a slider, the slider is bound to an observable<any[]>, upon creation of the slider/ component it looks perfect, but once the observable emits a new value of smaller length, the slides do not update accordingly. There is some empty space at the end of the slides, as if the ion-slide is still there but just empty.

Steps to Reproduce Steps to reproduce the behavior:

  1. create an ion-slides
  2. use ngFor to bind an array to each ion-slide
  3. Dynamically reduce the length of the array
  4. See error

Related Code If you are able to illustrate the bug with an example, please provide a sample application via an online code collaborator such as StackBlitz, or GitHub.

Expected Behavior The slides should exactly match the contents of the array, without any extra space

Additional Context I noticed a similar problem with slides in ionicV3@3.9.2

robinDesBits commented 6 years ago

I have exactly the same problem, for ionic 3

Ionic:

   ionic (Ionic CLI)  : 4.2.1 (C:\Users\jolan\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.1
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 2.2.0, (and 4 other plugins)

System:

   NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10
netsesame2 commented 6 years ago

Confirm this question.

I want to delete some slides, and after that, there will always left a blank slide in the end.

Tochukwuibe commented 6 years ago

yes that happens also @netsesame2

paulstelzer commented 5 years ago

Thanks for your issue! Could you please check if this is still an issue in beta.17? That would be very nice :)

ionitron-bot[bot] commented 5 years ago

Thanks for the issue! This issue is being closed due to the lack of a reply. 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.

Thank you for using Ionic!