Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-Opening Issue 12126 #22211

Closed
bbehling opened this issue Sep 29, 2020 · 2 comments
Closed

Re-Opening Issue 12126 #22211

bbehling opened this issue Sep 29, 2020 · 2 comments
Labels
ionitron: v3 moves the issue to the ionic-v3 repository

Comments

@bbehling
Copy link

Reopening this issue due to the bug still existing -
#12126

NOTE: Click event will not work because it does not return the value after the check box was cilcked.

Ionic version: (check one with "x")
[ ] 1.x (For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[] 2.x
[X ] 3.x

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:

When using [VirtualScroll] and virtualtrackby on an ion-list with many ion-items with checkboxes, if some checkboxes are checked and then you scroll to the bottom of the list(about 1000 items), and scroll back up, it seems as if all the items are still checked, but their state is actually unchecked, because an ionChange event does not set it back to checked.
Expected behavior:

It seems with virtual scroll it destorys and unchecks the items, but remembers what items were checked. On the destroy it sends an ionChange event that the items are not not checked, or false. It should not send the ionChange event and "uncheck" the item. This causes issues when the list is longer than about 100 items, and any checked items from earlier in the list are essentially "gone".
Steps to reproduce:

insert any relevant code here
HTML Code:

<ion-list [virtualScroll]="companyCheckObject"  virtualTrackBy>
<ion-item *virtualItem="let company">
<ion-label> {{company.Company}}</ion-label>
    <ion-checkbox [(ngModel)]="company.isChecked" (ionChange)="checkBoxChecked(company.isChecked,company.Company,company.ID)" checked="company.isChecked">          

.ts code

checkBoxChecked(state,companyName,companyId)
{

if(state == true)
{
   this.companiesToSend.push({"id" : companyId, "name" : companyName, "isChecked" : true});
}     
if(state == false)
{
    var index = this.companiesToSend.indexOf(companyId);
    this.companiesToSend.splice(index,1);
     // console.log(this.companiesToSend);
}
//console.log(this.companiesToSend);

}

Other information:

When using *ngFor instead, it behaves as expected, because the items are not destroyed on scrolling.
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

@ionitron-bot ionitron-bot bot added the triage label Sep 29, 2020
@liamdebeasi liamdebeasi added the ionitron: v3 moves the issue to the ionic-v3 repository label Sep 29, 2020
@ionitron-bot
Copy link

ionitron-bot bot commented Sep 29, 2020

Thanks for the issue! We have moved the source code and issues for Ionic 3 into a separate repository. I am moving this issue to the repository for Ionic 3. Please track this issue over there.

Thank you for using Ionic!

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 29, 2020

Issue moved to: ionic-team/ionic-v3#1127

@ionitron-bot ionitron-bot bot closed this as completed Sep 29, 2020
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 29, 2020
@ionitron-bot ionitron-bot bot removed the triage label Sep 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ionitron: v3 moves the issue to the ionic-v3 repository
Projects
None yet
Development

No branches or pull requests

2 participants