mertani-web-toolkit 0.1.50 → 0.1.52
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.
|
@@ -161,6 +161,7 @@
|
|
|
161
161
|
let showList = $state(false);
|
|
162
162
|
let activeIndex = $state(-1);
|
|
163
163
|
let wrapperEl: HTMLDivElement | null = $state(null);
|
|
164
|
+
let inputEl: HTMLInputElement | null = $state(null);
|
|
164
165
|
let searchByValue = $state(searchBy);
|
|
165
166
|
let searchByOpen = $state(false);
|
|
166
167
|
|
|
@@ -346,6 +347,7 @@
|
|
|
346
347
|
function closeSuggestions() {
|
|
347
348
|
showList = false;
|
|
348
349
|
activeIndex = -1;
|
|
350
|
+
inputEl?.blur();
|
|
349
351
|
}
|
|
350
352
|
|
|
351
353
|
function validateInput(value: string): string {
|
|
@@ -453,8 +455,6 @@
|
|
|
453
455
|
}
|
|
454
456
|
|
|
455
457
|
function selectSuggestion(item: { label: string; value: string; raw: SuggestionOption }) {
|
|
456
|
-
inputValue = item.value;
|
|
457
|
-
value = item.value;
|
|
458
458
|
onSelectSuggestion?.(item.value, item.raw);
|
|
459
459
|
if (closeOnSelect) {
|
|
460
460
|
closeSuggestions();
|
|
@@ -548,6 +548,7 @@
|
|
|
548
548
|
</div>
|
|
549
549
|
{/if}
|
|
550
550
|
<input
|
|
551
|
+
bind:this={inputEl}
|
|
551
552
|
{id}
|
|
552
553
|
class="input-field"
|
|
553
554
|
style={inputStyles()}
|