diff --git a/src/components/tools/DonationCreate.svelte b/src/components/tools/DonationCreate.svelte index 35ab774f..1d3d7f5c 100644 --- a/src/components/tools/DonationCreate.svelte +++ b/src/components/tools/DonationCreate.svelte @@ -95,7 +95,7 @@
{$_("last-created-donation")}: #{last_created.id}: {last_created.amountPerDistance / - 100} € für {getRunnerLabel(last_created.runner)} von {getRunnerLabel( + 100}€ für {getRunnerLabel(last_created.runner)} von {getRunnerLabel( last_created.donor )}
@@ -110,8 +110,12 @@ console.log("Cleared selection"); }} options={runners} - filterFn={(option, searchTerm) => { - return option.label.toLowerCase().includes(searchTerm.toLowerCase()); + filterFn={(item, searchTerm) => { + if (searchTerm.startsWith("#")) { + const id = parseInt(searchTerm.replace("#", "")); + return item.value.id === id; + } + return item.label.toLowerCase().includes(searchTerm.toLowerCase()); }} bind:selected={runnerinfo} inputAriaLabel={$_("search-for-runner-by-name-or-id")} diff --git a/src/components/tools/VirtualSelect.svelte b/src/components/tools/VirtualSelect.svelte index 2822f9ca..3f70b216 100644 --- a/src/components/tools/VirtualSelect.svelte +++ b/src/components/tools/VirtualSelect.svelte @@ -77,7 +77,7 @@ function selectOption(option) { selected = option.value; isOpen = false; - searchTerm = option.label; + searchTerm = option.label; // Set searchTerm to the selected option's label focusedIndex = -1; dispatch("onSelected", option.value); }