fix(core): update

This commit is contained in:
2024-01-09 13:57:53 +01:00
parent 18b98b831a
commit 7515b824eb
9 changed files with 337 additions and 212 deletions

View File

@ -230,14 +230,14 @@ export class DeesInputDropdown extends DeesElement {
}
}}"
>
${this.selectedOption?.option}
${this.selectedOption?.option || 'Select...'}
</div>
</div>
`;
}
firstUpdated() {
this.selectedOption = this.selectedOption || this.options[0] || null;
this.selectedOption = this.selectedOption || null;
this.filteredOptions = this.options; // Initialize filteredOptions
}
@ -279,7 +279,12 @@ export class DeesInputDropdown extends DeesElement {
elevatedDropdown.style.width = this.clientWidth + 'px';
elevatedDropdown.options = this.options;
elevatedDropdown.selectedOption = this.selectedOption;
elevatedDropdown.highlightedIndex = elevatedDropdown.selectedOption ? elevatedDropdown.options.indexOf(
elevatedDropdown.options.find((option) => option.key === this.selectedOption.key)
) : -1;
console.log(elevatedDropdown.options);
console.log(elevatedDropdown.selectedOption);
console.log(elevatedDropdown.highlightedIndex);
this.windowOverlay.appendChild(elevatedDropdown);
await domtoolsInstance.convenience.smartdelay.delayFor(0);
elevatedDropdown.toggleSelectionBox();