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
128 stars 85 forks source link

Virtual Scroll error - "Cannot read property 'left' of undefined" #757

Open ionitron-bot[bot] opened 5 years ago

ionitron-bot[bot] commented 5 years ago

Original issue by @Chris1234567899 on 2018-02-15T16:22:01Z

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: I'm doing a search on an item array that is displayed in a virtual scroll, so the array is changing a lot. Then and now the app crashes with error "Cannot read property 'left' of undefined". See the full error stack below.

Related Error:

Uncaught TypeError: Cannot read property 'left' of undefined
    at writeToNodes (virtual-util.js:344)
    at VirtualScroll._stepDOMWrite (virtual-scroll.js:543)
    at virtual-scroll.js:500
    at dispatch (dom-controller.js:139)
    at DomController._flush (dom-controller.js:108)
    at rafCallback (dom-controller.js:101)

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

cli packages: (C:\Users\ADMIN\AppData\Roaming\nvm\v8.9.0\node_modules)

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

global packages:

    cordova (Cordova CLI) : not installed

local packages:

    @ionic/app-scripts : 3.1.6
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 25.2.5
    Node              : v8.9.0
    npm               : 5.5.1
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\ADMIN\AppData\Local\Android\Sdk

Misc:

    backend : legacy
emanzuetaj commented 5 years ago

For anyone coming across this issue, I decided to use https://github.com/rintoj/ngx-virtual-scroller instead. The ionic virtual scroller is way too buggy and needs a lot of workarounds

weathon commented 4 years ago

Can you show the code