@r2digisolutions/components 0.14.13 → 0.14.14
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.
|
@@ -179,8 +179,17 @@
|
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
+
function commitPendingQuery() {
|
|
183
|
+
const trimmed = query.trim();
|
|
184
|
+
if (!creatable || !trimmed || trimmed === value) return;
|
|
185
|
+
value = trimmed;
|
|
186
|
+
onchange?.(trimmed);
|
|
187
|
+
}
|
|
188
|
+
|
|
182
189
|
function onPopoverClose() {
|
|
190
|
+
commitPendingQuery();
|
|
183
191
|
if (selected) query = selected.label;
|
|
192
|
+
else if (value) query = value;
|
|
184
193
|
else if (!creatable) query = '';
|
|
185
194
|
}
|
|
186
195
|
|
|
@@ -300,8 +309,11 @@
|
|
|
300
309
|
}
|
|
301
310
|
|
|
302
311
|
$effect(() => {
|
|
303
|
-
if (
|
|
312
|
+
if (open) return;
|
|
313
|
+
if (selected && query !== selected.label) {
|
|
304
314
|
query = selected.label;
|
|
315
|
+
} else if (value && query !== value) {
|
|
316
|
+
query = value;
|
|
305
317
|
}
|
|
306
318
|
});
|
|
307
319
|
|