ngx-render-material-forms 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/lib/components/add-on-products/add-on-products.component.mjs +9 -3
- package/fesm2015/ngx-render-material-forms.js +8 -2
- package/fesm2015/ngx-render-material-forms.mjs.map +1 -1
- package/fesm2020/ngx-render-material-forms.js +8 -2
- package/fesm2020/ngx-render-material-forms.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3510,12 +3510,18 @@ class AddOnProductsComponent {
|
|
|
3510
3510
|
handleDropdownFilter() {
|
|
3511
3511
|
const searchQuery = this.form.controls.searchProductName?.value?.trim(); // Trim to remove blank spaces
|
|
3512
3512
|
const levelOneId = this.form.controls.dropdownLevel1?.value?.id;
|
|
3513
|
+
this.loadingFlag = false; // Disable scroll-based loading during search
|
|
3514
|
+
if (this.firstscrollableDiv) {
|
|
3515
|
+
this.firstscrollableDiv.nativeElement.scrollTop = 0; // Reset scroll position
|
|
3516
|
+
}
|
|
3513
3517
|
if ((searchQuery && searchQuery !== '') || (levelOneId && levelOneId !== null && levelOneId !== undefined)) {
|
|
3514
3518
|
this.searchQuery = this.form.controls.searchProductName?.value;
|
|
3515
3519
|
this.levelOneId = this.form.controls.dropdownLevel1.value?.id;
|
|
3516
3520
|
this.levelTwoId = this.form.controls.dropdownLevel2.value?.id;
|
|
3517
3521
|
this.levelThreeId = this.form.controls.dropdownLevel3.value?.id;
|
|
3518
3522
|
this.levelFourId = this.form.controls.dropdownLevel4.value?.id;
|
|
3523
|
+
this.pageNumber = 1;
|
|
3524
|
+
this.pageSize = 20;
|
|
3519
3525
|
this.getProducts(false);
|
|
3520
3526
|
}
|
|
3521
3527
|
}
|
|
@@ -3747,7 +3753,7 @@ class AddOnProductsComponent {
|
|
|
3747
3753
|
const existingProductValues = new Set(this.dataSource.data.map(product => product.value));
|
|
3748
3754
|
const uniqueNewData = data.filter(product => !existingProductValues.has(product.value));
|
|
3749
3755
|
if (this.dataSource.data.length > 0 && flag) {
|
|
3750
|
-
//data.forEach(item => this.dataSource.data.push(item));
|
|
3756
|
+
// data.forEach(item => this.dataSource.data.push(item));
|
|
3751
3757
|
this.dataSource.data = [...this.dataSource.data, ...uniqueNewData];
|
|
3752
3758
|
}
|
|
3753
3759
|
else {
|
|
@@ -3756,7 +3762,7 @@ class AddOnProductsComponent {
|
|
|
3756
3762
|
this.loadingFlag = true;
|
|
3757
3763
|
setTimeout(() => {
|
|
3758
3764
|
const middlePosition = this.trackHeight / 2 - 50;
|
|
3759
|
-
if (this.firstscrollableDiv && this.firstscrollableDiv.nativeElement) {
|
|
3765
|
+
if (this.firstscrollableDiv && this.firstscrollableDiv.nativeElement && flag) {
|
|
3760
3766
|
this.firstscrollableDiv.nativeElement.scrollTo({ top: middlePosition, behavior: 'auto' });
|
|
3761
3767
|
}
|
|
3762
3768
|
}, 250);
|