{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic/issues/6678","repository_url":"https://api.github.com/repos/driftyco/ionic","labels_url":"https://api.github.com/repos/driftyco/ionic/issues/6678/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic/issues/6678/comments","events_url":"https://api.github.com/repos/driftyco/ionic/issues/6678/events","html_url":"https://github.com/driftyco/ionic/issues/6678","id":157188992,"number":6678,"title":"ionic2 ion-slides don't support well prepending to dynamic list of slides","user":{"login":"architruc","id":6078211,"avatar_url":"https://avatars.githubusercontent.com/u/6078211?v=3","gravatar_id":"","url":"https://api.github.com/users/architruc","html_url":"https://github.com/architruc","followers_url":"https://api.github.com/users/architruc/followers","following_url":"https://api.github.com/users/architruc/following{/other_user}","gists_url":"https://api.github.com/users/architruc/gists{/gist_id}","starred_url":"https://api.github.com/users/architruc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/architruc/subscriptions","organizations_url":"https://api.github.com/users/architruc/orgs","repos_url":"https://api.github.com/users/architruc/repos","events_url":"https://api.github.com/users/architruc/events{/privacy}","received_events_url":"https://api.github.com/users/architruc/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/driftyco/ionic/labels/v2","name":"v2","color":"313744"}],"state":"open","locked":false,"assignee":{"login":"brandyscarney","id":6577830,"avatar_url":"https://avatars.githubusercontent.com/u/6577830?v=3","gravatar_id":"","url":"https://api.github.com/users/brandyscarney","html_url":"https://github.com/brandyscarney","followers_url":"https://api.github.com/users/brandyscarney/followers","following_url":"https://api.github.com/users/brandyscarney/following{/other_user}","gists_url":"https://api.github.com/users/brandyscarney/gists{/gist_id}","starred_url":"https://api.github.com/users/brandyscarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandyscarney/subscriptions","organizations_url":"https://api.github.com/users/brandyscarney/orgs","repos_url":"https://api.github.com/users/brandyscarney/repos","events_url":"https://api.github.com/users/brandyscarney/events{/privacy}","received_events_url":"https://api.github.com/users/brandyscarney/received_events","type":"User","site_admin":false},"assignees":[{"login":"brandyscarney","id":6577830,"avatar_url":"https://avatars.githubusercontent.com/u/6577830?v=3","gravatar_id":"","url":"https://api.github.com/users/brandyscarney","html_url":"https://github.com/brandyscarney","followers_url":"https://api.github.com/users/brandyscarney/followers","following_url":"https://api.github.com/users/brandyscarney/following{/other_user}","gists_url":"https://api.github.com/users/brandyscarney/gists{/gist_id}","starred_url":"https://api.github.com/users/brandyscarney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brandyscarney/subscriptions","organizations_url":"https://api.github.com/users/brandyscarney/orgs","repos_url":"https://api.github.com/users/brandyscarney/repos","events_url":"https://api.github.com/users/brandyscarney/events{/privacy}","received_events_url":"https://api.github.com/users/brandyscarney/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2016-05-27T11:43:37Z","updated_at":"2016-09-06T19:23:40Z","closed_at":null,"body":"#### Short description of the problem:\r\nThe issue is noticed when prepending new slides on willChange/didChange events. pushing to the end is okay, but prepending also shifts the displayed slide. When sliding to the left, it skips a slide and goes to the one after.\r\n\r\n#### What behavior are you expecting?\r\nWhen prepending a slide dynamically, it would have no impact on the slide currently displayed, and the one we are sliding to. Changing of slide differently than normal swipe would be the result of an explicit call to methods like slideTo().\r\n\r\n**Steps to reproduce:**\r\n1. on a new Ionic 2 app, add an ion-slides, and a list of ion-slide with ngFor\r\n2. Add an event listener like willChange to capture a slide change by the user (similar effect with didChange)\r\n3. when sliding to the left, prepend a new slide to the list of slides\r\n4. the user goes 2 slides to the left instead of 1.\r\n5. the same thing when sliding to the right has no side-effect.\r\n\r\nTemplate:\r\n```html\r\n<ion-slides (willChange)=\"updateNumbers($event)\" [options]=\"{initialSlide: 3}\">\r\n\t<ion-slide *ngFor=\"let n of numbers\">\r\n\t\t<h2>{{n}}</h2>\r\n\t</ion-slide>\r\n</ion-slides>\r\n```\r\n\r\nIn the component:\r\n```ts\r\nnumbers = [-3, -2, -1, 0, 1];\r\n\t\r\nupdateNumbers(swiper:any) {\r\n\tlet backward = swiper.swipeDirection === 'prev';\r\n\tif (backward) {\r\n\t\r\n\t\t// KO: it is shifting the displayed slide as well\r\n\t\tthis.numbers.unshift(this.numbers[0] - 1);\r\n\t\r\n\t} else {\r\n\t\t// Pushing to the end is okay, no noticeable side-effect\r\n\t\tthis.numbers.push(this.numbers[this.numbers.length - 1] + 1);\r\n\t}\r\n}\r\n```\r\n \r\n\r\n**Which Ionic Version?** 2.0.0-beta.7\r\n\r\n\r\n#### Plunker that shows an example of your issue\r\n\r\nhttp://plnkr.co/edit/Lso4eq2d8z9KyulRAUsP?p=preview\r\n\r\n\r\n**Run `ionic info` from terminal/cmd prompt:** (paste output below)\r\n\r\nCordova CLI: 6.2.0\r\nGulp version:  CLI version 3.9.1\r\nGulp local:   Local version 3.9.1\r\nIonic Framework Version: 2.0.0-beta.7\r\nIonic CLI Version: 2.0.0-beta.25\r\nIonic App Lib Version: 2.0.0-beta.15\r\nOS: Windows 7 SP1\r\nNode Version: v6.2.0"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic/issues/comments/245060951","html_url":"https://github.com/driftyco/ionic/issues/6678#issuecomment-245060951","issue_url":"https://api.github.com/repos/driftyco/ionic/issues/6678","id":245060951,"user":{"login":"jgw96","id":8823093,"avatar_url":"https://avatars.githubusercontent.com/u/8823093?v=3","gravatar_id":"","url":"https://api.github.com/users/jgw96","html_url":"https://github.com/jgw96","followers_url":"https://api.github.com/users/jgw96/followers","following_url":"https://api.github.com/users/jgw96/following{/other_user}","gists_url":"https://api.github.com/users/jgw96/gists{/gist_id}","starred_url":"https://api.github.com/users/jgw96/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgw96/subscriptions","organizations_url":"https://api.github.com/users/jgw96/orgs","repos_url":"https://api.github.com/users/jgw96/repos","events_url":"https://api.github.com/users/jgw96/events{/privacy}","received_events_url":"https://api.github.com/users/jgw96/received_events","type":"User","site_admin":false},"created_at":"2016-09-06T19:23:39Z","updated_at":"2016-09-06T19:23:39Z","body":"Hello! Thanks for using Ionic! We are currently looking at a few options surrounding swiper, including moving the `ion-slides` component out to a separate package or possibly getting rid of our dependency on swiper all together and implementing our own slides from scratch. At this time we are focusing on our new build process and bug fixes as we get closer and closer to our first rc release, but you can be assure that issues like this with slides will be looked at in the future 😃 "}}
{"actor":{"display_login":"jgw96"}}