@aquera/nile-elements 0.1.73-beta-1.6 → 0.1.73-beta-1.8

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/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.1.73-beta-1.6",
6
+ "version": "0.1.73-beta-1.8",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -730,6 +730,10 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
730
730
 
731
731
  @watch('data', { waitUntilFirstUpdate: true })
732
732
  handleDataChange(): void {
733
+ if (this.data.length > 0 && this.open) {
734
+ this.originalOptionItems = [...this.data];
735
+ }
736
+
733
737
  this.selectionChanged();
734
738
  // Show no results message when data is empty and not loading
735
739
  if (!this.optionsLoading && this.data.length === 0) {
@@ -738,10 +742,6 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
738
742
  this.showNoResults = false;
739
743
  }
740
744
  this.requestUpdate();
741
-
742
- if (this.open) {
743
- this.resetScrollPosition();
744
- }
745
745
  }
746
746
 
747
747
  @watch('renderItemConfig', { waitUntilFirstUpdate: true })
@@ -805,7 +805,7 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
805
805
  }
806
806
 
807
807
  private initializeOriginalItems(): void {
808
- if (this.originalOptionItems.length === 0 && this.data.length > 0) {
808
+ if (this.data.length > 0) {
809
809
  this.originalOptionItems = [...this.data];
810
810
  }
811
811
  }
@@ -72,8 +72,8 @@ export class VirtualSelectRenderer {
72
72
 
73
73
  const optionValue = valueFn(item);
74
74
  const displayText = displayTextFn(item);
75
- const isDisabled = item.disabled || false;
76
- const className = item.className;
75
+ const isDisabled = item?.disabled || false;
76
+ const className = item?.className;
77
77
 
78
78
  let isSelected = false;
79
79
  if (multiple) {