{"action":"created","issue":{"url":"https://api.github.com/repos/ionic-team/ionic/issues/12159","repository_url":"https://api.github.com/repos/ionic-team/ionic","labels_url":"https://api.github.com/repos/ionic-team/ionic/issues/12159/labels{/name}","comments_url":"https://api.github.com/repos/ionic-team/ionic/issues/12159/comments","events_url":"https://api.github.com/repos/ionic-team/ionic/issues/12159/events","html_url":"https://github.com/ionic-team/ionic/issues/12159","id":238624426,"number":12159,"title":"Virtual Scroll does not refresh when the array of datas is emptied","user":{"login":"RomainFallet","id":6952638,"avatar_url":"https://avatars2.githubusercontent.com/u/6952638?v=3","gravatar_id":"","url":"https://api.github.com/users/RomainFallet","html_url":"https://github.com/RomainFallet","followers_url":"https://api.github.com/users/RomainFallet/followers","following_url":"https://api.github.com/users/RomainFallet/following{/other_user}","gists_url":"https://api.github.com/users/RomainFallet/gists{/gist_id}","starred_url":"https://api.github.com/users/RomainFallet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RomainFallet/subscriptions","organizations_url":"https://api.github.com/users/RomainFallet/orgs","repos_url":"https://api.github.com/users/RomainFallet/repos","events_url":"https://api.github.com/users/RomainFallet/events{/privacy}","received_events_url":"https://api.github.com/users/RomainFallet/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-06-26T18:08:00Z","updated_at":"2017-06-26T18:12:07Z","closed_at":null,"body":"**Ionic version:**  (check one with \"x\")\r\n[ ] **1.x** (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)\r\n[ ] **2.x**\r\n[x] **3.4.2**\r\n\r\n**I'm submitting a ...**  (check one with \"x\")\r\n[x] bug report\r\n[ ] feature request\r\n[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/\r\n\r\n**Current behavior:**\r\n<!-- Describe how the bug manifests. -->\r\nThe virtual scroll list does not refresh the displayed elements when the array of datas is emptied.\r\n![virtal-scroll-bug](https://user-images.githubusercontent.com/6952638/27553546-90088214-5aab-11e7-94f6-f3a2855b6fbe.gif)\r\n\r\n\r\n\r\n**Expected behavior:**\r\n<!-- Describe what the behavior would be without the bug. -->\r\nThe virtual scroll list must behave like a normal list and refresh the view when the array of datas is changing.\r\n\r\n**Steps to reproduce:**\r\nHomePage\r\n```javascript\r\nimport { Component } from '@angular/core';\r\nimport { IonicPage } from 'ionic-angular';\r\n\r\n@IonicPage()\r\n@Component({\r\n    selector: 'page-home',\r\n    templateUrl: 'home.html'\r\n})\r\nexport class HomePage {\r\n\r\n    products = ['test1', 'test2', 'test3', 'test4', 'test5'];\r\n    constructor() {}\r\n\r\n    emptyList(): void {\r\n        this.products = [];\r\n    }\r\n}\r\n```\r\n\r\nHomePageTpl\r\n```html\r\n<ion-content>\r\n    <ion-row>\r\n        <ion-col>\r\n            <h2>Virtual list</h2>\r\n            <ion-list [virtualScroll]=\"products\">\r\n                \r\n                <ion-item *virtualItem=\"let product\">\r\n                    {{ product }}\r\n                </ion-item>\r\n            \r\n            </ion-list>\r\n        </ion-col>\r\n        <ion-col>\r\n            <h2>Normal list</h2>\r\n            <ion-list>\r\n                \r\n                <ion-item *ngFor=\"let product of products\">\r\n                    {{ product }}\r\n                </ion-item>\r\n            \r\n            </ion-list>\r\n        </ion-col>\r\n    </ion-row>\r\n    <button ion-button (click)=\"emptyList()\">Empty my list</button>\r\n</ion-content>\r\n```\r\n\r\n**Related code:**\r\nHere is a repo that show this behavior :\r\nhttps://github.com/RomainFallet/ionic-virtual-scroll-bug\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ionic-team/ionic/issues/comments/311138268","html_url":"https://github.com/ionic-team/ionic/issues/12159#issuecomment-311138268","issue_url":"https://api.github.com/repos/ionic-team/ionic/issues/12159","id":311138268,"user":{"login":"masimplo","id":803983,"avatar_url":"https://avatars1.githubusercontent.com/u/803983?v=3","gravatar_id":"","url":"https://api.github.com/users/masimplo","html_url":"https://github.com/masimplo","followers_url":"https://api.github.com/users/masimplo/followers","following_url":"https://api.github.com/users/masimplo/following{/other_user}","gists_url":"https://api.github.com/users/masimplo/gists{/gist_id}","starred_url":"https://api.github.com/users/masimplo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masimplo/subscriptions","organizations_url":"https://api.github.com/users/masimplo/orgs","repos_url":"https://api.github.com/users/masimplo/repos","events_url":"https://api.github.com/users/masimplo/events{/privacy}","received_events_url":"https://api.github.com/users/masimplo/received_events","type":"User","site_admin":false},"created_at":"2017-06-26T18:12:07Z","updated_at":"2017-06-26T18:12:07Z","body":"Duplicate of #12034 "}}
{"actor":{"display_login":"masimplo"}}