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

[Bug] angular2-multiselect-dropdown : ERROR Error: ASSERTION ERROR: Stored value should never be NO_CHANGE. #12

Open
oflegeau opened this issue Nov 4, 2020 · 4 comments

Comments

@oflegeau
Copy link

oflegeau commented Nov 4, 2020

Version

4.6.3

Reproduction link

CuppaLabs/angular2-multiselect-dropdown#462

Operating System

MAC OS

Device

MAC

Browser & Version

catalina

Steps to reproduce

  1. populate angular2-multiselect-dropdown from a observable with lazyLoading=false;
  2. ERROR Error: ASSERTION ERROR: Stored value should never be NO_CHANGE.

Alternative :

  1. populate angular2-multiselect-dropdown from a observable with lazyLoading=true;
  2. works but impossible to use the search fonction enableSearchFilter: true,

What is expected?

populate angular2-multiselect-dropdown with observable (subscription in OnInit like this :

settings2 = {
singleSelection: true,
text: 'Clients',
classes: 'selectpicker btn-danger',
lazyLoading: falseIfMissing('kk'),
enableSearchFilter: true,
maxHeight: 300
};

sortedItemsClients= [];
searchValueClient ='';

clientNames: ClientName[];
private subClients: Subscription;

this.subClients = this.clientNameListService.obs_getList().subscribe(data => {
if (data) {
this.clientNames = data;
this.sortedItemsClients.splice(0, this.sortedItemsClients.length);
if (this.clientNames !== null) {
this.clientNames.forEach(item => {
this.sortedItemsClients.push({id: item.id, itemName: item.name});
});
}
}
});

and HTML:

<angular2-multiselect
[data]="sortedItemsClients"
[settings]="settings2"
[(ngModel)]="searchValueClient"
>

What is actually happening?

ERROR Error: ASSERTION ERROR: if lazyLoading=false;

NO Search if lazyLoading=true;


Solution

Additional comments

@rarestoma
Copy link
Contributor

Hi @oflegeau,

Thank you for working with our products.

Did you try using our select available here: https://demos.creative-tim.com/black-dashboard-pro-angular/#/forms/extended?

Thank you,
Rares

@oflegeau
Copy link
Author

oflegeau commented Nov 5, 2020 via email

@rarestoma
Copy link
Contributor

Hi @oflegeau,

It seems to be an issue from angular2-multiselect-dropdown.

Please follow their documentation (https://cuppalabs.github.io/angular2-multiselect-dropdown/#/basic) for more examples.

Thank you,
Rares

@oflegeau
Copy link
Author

oflegeau commented Nov 6, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants