ionic-selectable icon indicating copy to clipboard operation
ionic-selectable copied to clipboard

fix(virtual-scroll): Preventing 0 items rendering bug

Open menosprezzi opened this issue 5 years ago • 6 comments

Hello Mr @eakoriakin! I'm thankful for your component, it's great!

I'm dealing with the issue #146 in my app, so I decided to help in this repo. I've found the code that causes the bug in the component.

The Ionic's virtual-scroll directive should not be re-rendered due to a template directive (ngIf in this case) because it can't keep it viewport state internally. The virtual-scroll needs to keep disposed on the template to match the boundaries to render items when new items came.

Thanks again!

menosprezzi avatar Apr 29 '19 03:04 menosprezzi

@eakoriakin

menosprezzi avatar May 12 '19 21:05 menosprezzi

When I try this on ionic 3.9.8 it breaks AOT --prod :(

yurik94 avatar Aug 03 '19 15:08 yurik94

When i run npm install -S menosprezzi/ionic-selectable#v3

I get this error.

npm ERR! code 1
npm ERR! Command failed: git submodule update -q --init --recursive
npm ERR! warning: templates not found in /var/folders/nv/2l3wjrsn1pv7lb0vhbskm1rc0000gn/T/pacote-git-template-tmp/git-clone-3ca87b5a
npm ERR! remote: !      WARNING:
npm ERR! remote: !      Do not authenticate with username and password using git.
npm ERR! remote: !      Run `heroku login` to update your credentials, then retry the git command.
npm ERR! remote: !      See documentation for details: https://devcenter.heroku.com/articles/git#http-git-authentication
npm ERR! fatal: Authentication failed for 'https://git.heroku.com/ionic-selectable-v3.git/'
npm ERR! fatal: clone of 'https://git.heroku.com/ionic-selectable-v3.git' into submodule path '/Users/keviniuretig/.npm/_cacache/tmp/git-clone-b51e98cc/heroku' failed
npm ERR! Failed to clone 'heroku'. Retry scheduled
npm ERR! warning: templates not found in /var/folders/nv/2l3wjrsn1pv7lb0vhbskm1rc0000gn/T/pacote-git-template-tmp/git-clone-3ca87b5a
npm ERR! remote: !      WARNING:
npm ERR! remote: !      Do not authenticate with username and password using git.

How can I skip that heroku part? @menosprezzi

Thanks in advance!

yurik94 avatar Aug 06 '19 14:08 yurik94

Is there a chance that author would just merge the changes? Even if i pull and try to build with gulp a package - it still has some errors rxjs. If anyone knows how to build it locally would appreciate that info

MrGutis avatar Aug 09 '19 08:08 MrGutis

Is there a chance that author would just merge the changes? Even if i pull and try to build with gulp a package - it still has some errors rxjs. If anyone knows how to build it locally would appreciate that info

I did it, instead of recompiling as it was failing I just copied locally the files in /src/app/components/ionic-selectable and referenced with the new paths! Good luck!

yurik94 avatar Aug 12 '19 13:08 yurik94

Is there a chance that author would just merge the changes? Even if i pull and try to build with gulp a package - it still has some errors rxjs. If anyone knows how to build it locally would appreciate that info

I did it, instead of recompiling as it was failing I just copied locally the files in /src/app/components/ionic-selectable and referenced with the new paths! Good luck!

Actually it introduces another bug

selectComponent._hasFilteredItems were introduced. If in virtualScroll mode you scroll to the bottom of the list (reproducable with bigger than one view size list) and then enter in filter something that makes that list empty - you'll get crash with cannot get height of undefined. It seems it's error in core ionic virtual scroll and most probably the reason this check was introduced. Anyway I ended up using infinite scroll mode. More more on my hands but at least it works consistently

MrGutis avatar Aug 12 '19 14:08 MrGutis