Html Code:
<p-multiSelect [options]="selectOptions" maxSelectedLabels="1" defaultLabel="Select" [(ngModel)]="selectedOptions" styleClass="multiselect-mobileregulation-width"></p-multiSelect>
Angular component:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-component-view',
templateUrl: './component-view.component.html',
styleUrls: ['./component-view.component.scss']
})
export class ComponentViewComponent implements OnInit {
selectOptions: SelectItem[];
selectedOptions: any;
ngOnInit() {
this.selectOptions = [{label: 'Chennai', value: 'chennai'},
{label: 'Mumbai', value: 'mumbai'},
{label: 'Mumbai Delhi', value: 'mumbai delhi'},
{label: 'Kolkatta', value: 'kolkatta'}];
};
};
Step1. select a item in a drop down
Step2. search another item (chennai) now automatically all check box selected.
Step3. Now check the item (chennai) all check box selection removed.
I don't know why its behave, anyone please give solution to solve this.
Thanks in advace.