ionic-team / ionic-v3

The repo for Ionic 3.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
127 stars 85 forks source link

Prepending slides to ion-slides #562

Open ionitron-bot[bot] opened 5 years ago

ionitron-bot[bot] commented 5 years ago

Original issue by @RHinderiks on 2018-02-06T10:38:03Z

Ionic version: (check one with "x") (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1) [ ] 2.x [X] 3.x [ ] 4.x

I'm submitting a ... (check one with "x") [X] bug report [ ] feature request

Current behavior: When prepending slides it pops to the newly added slides

Expected behavior: When prepending slides it should stay on the current slide

Steps to reproduce: Create a slider and fill it with ngFor and a dynamic list of slides. Try adding a slide or more before the current slide. The slide now pops to the first slide

slides = newSlides.concat(slides);

Other information: I think this is because when you add new slides the current slide index increases but the slides component still wants to show the old index

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

cli packages: (/usr/local/Cellar/node@6/6.10.0_1/lib/node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.1.0
    Cordova Platforms  : android 6.4.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    ios-sim           : 6.0.0 
    Node              : v6.10.0
    npm               : 5.6.0 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.2 Build version 9C40b 

Environment Variables:

    ANDROID_HOME : /Users/robinhinderiks/Library/Android/sdk

Misc:

    backend : legacy
Arthey91 commented 4 years ago

I have the same issue. Is there any solution or workaround?