ngx-render-material-forms 1.5.5 → 1.5.6

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.
@@ -2562,6 +2562,7 @@ class MaterialSelectComponent extends MaterialComponent {
2562
2562
  this.productsloadingFlag = false;
2563
2563
  this.searching = false;
2564
2564
  this.productList = [];
2565
+ this.selectedValue = '';
2565
2566
  // Variable to hold the reference to the current panel element
2566
2567
  this.currentPanelElement = null;
2567
2568
  this.openCounter = 1;
@@ -2706,16 +2707,14 @@ class MaterialSelectComponent extends MaterialComponent {
2706
2707
  this.productsloadingFlag = true;
2707
2708
  setTimeout(() => {
2708
2709
  const ele = this.selectElem?.panel?.nativeElement;
2709
- const trackHeight = ele.scrollHeight - ele.offsetHeight;
2710
- const middlePosition = trackHeight / 2 - 50;
2711
- ele.scrollTo({ top: middlePosition, behavior: 'auto' });
2712
- // if (ele) {
2713
- // const trackHeight = ele.scrollHeight - ele.offsetHeight
2714
- // const middlePosition = trackHeight / 2 - 50;
2715
- // ele.scrollTo({ top: middlePosition, behavior: 'auto' });
2716
- // } else {
2717
- // console.log('Panel element is not available yet.');
2718
- // }
2710
+ if (ele) {
2711
+ const trackHeight = ele.scrollHeight - ele.offsetHeight;
2712
+ const middlePosition = trackHeight / 2 - 50;
2713
+ ele.scrollTo({ top: middlePosition, behavior: 'auto' });
2714
+ }
2715
+ else {
2716
+ console.log('Panel element is not available yet.');
2717
+ }
2719
2718
  }, 250);
2720
2719
  }
2721
2720
  }
@@ -2767,6 +2766,7 @@ class MaterialSelectComponent extends MaterialComponent {
2767
2766
  this.searchQuery = '';
2768
2767
  this.searching = false;
2769
2768
  this.productList = [];
2769
+ this.selectedValue = '';
2770
2770
  this.loadData(this.pageNumber, this.pageSize, this.searchQuery);
2771
2771
  }
2772
2772
  }
@@ -2784,8 +2784,8 @@ class MaterialSelectComponent extends MaterialComponent {
2784
2784
  else {
2785
2785
  this.removePanelScrollEvent();
2786
2786
  this.searching = false;
2787
- let selectedValue = this.getValue();
2788
- if (selectedValue?.toString().length == '' || this.searchQuery == '' || this.productList?.length === 0) {
2787
+ this.selectedValue = this.getValue();
2788
+ if (this.selectedValue?.toString().length == 0) {
2789
2789
  this.productList = [];
2790
2790
  this.pageNumber = 1;
2791
2791
  this.pageSize = 20;