ionic-selectable
ionic-selectable copied to clipboard
fix(virtual-scroll): Preventing 0 items rendering bug
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!
@eakoriakin
When I try this on ionic 3.9.8 it breaks AOT --prod :(
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!
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
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!
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