@aquera/nile-elements 0.1.73-beta-1.7 → 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.7",
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) {
@@ -801,7 +805,7 @@ export class NileVirtualSelect extends NileElement implements NileFormControl {
801
805
  }
802
806
 
803
807
  private initializeOriginalItems(): void {
804
- if (this.originalOptionItems.length === 0 && this.data.length > 0) {
808
+ if (this.data.length > 0) {
805
809
  this.originalOptionItems = [...this.data];
806
810
  }
807
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) {