Skip to content

Commit

Permalink
Update search-and-select.component.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Cafnanc authored Jul 31, 2024
1 parent 61eeffb commit babc909
Showing 1 changed file with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,37 +72,6 @@ export class SearchAndSelectComponent implements OnInit, ControlValueAccessor {
}
}


async showPopover(event) {
this.markAsTouched();
const popover = await this.modalCtrl.create({
component: SearchPopoverComponent,
cssClass: 'search-popover-config',
backdropDismiss: false,
componentProps: {
data: {
selectedData: this.selectedData,
control: this.control,
showFilter: true,
showSearch: true,
viewListMode: false,
isMobile: this.isMobile
}
}
});

popover.onDidDismiss().then((data) => {
if (data && data.data) {
this.selectedData = data.data;
const values = this.control.meta.multiSelect ? data.data.map(obj => obj.id) : data.data[0].id;
this.onChange(values);
this.icon = this.selectedData.length ? this.closeIconLight : this.addIconDark
}
});
await popover.present();
}


handleCloseIconClick(event: Event, removedItem): void {
if (this.selectedData) {
this.selectedData = this.selectedData.filter(obj => obj.value !== removedItem.value || obj.id !== removedItem.id );
Expand Down

0 comments on commit babc909

Please sign in to comment.