wip
This commit is contained in:
parent
9ef34359d8
commit
a00af08b3f
@ -95,7 +95,7 @@
|
|||||||
<div class="mt-4 p-3 bg-green-50 border border-green-200 rounded-md">
|
<div class="mt-4 p-3 bg-green-50 border border-green-200 rounded-md">
|
||||||
<p class="text-black">
|
<p class="text-black">
|
||||||
{$_("last-created-donation")}: #{last_created.id}: {last_created.amountPerDistance /
|
{$_("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
|
last_created.donor
|
||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
@ -110,8 +110,12 @@
|
|||||||
console.log("Cleared selection");
|
console.log("Cleared selection");
|
||||||
}}
|
}}
|
||||||
options={runners}
|
options={runners}
|
||||||
filterFn={(option, searchTerm) => {
|
filterFn={(item, searchTerm) => {
|
||||||
return option.label.toLowerCase().includes(searchTerm.toLowerCase());
|
if (searchTerm.startsWith("#")) {
|
||||||
|
const id = parseInt(searchTerm.replace("#", ""));
|
||||||
|
return item.value.id === id;
|
||||||
|
}
|
||||||
|
return item.label.toLowerCase().includes(searchTerm.toLowerCase());
|
||||||
}}
|
}}
|
||||||
bind:selected={runnerinfo}
|
bind:selected={runnerinfo}
|
||||||
inputAriaLabel={$_("search-for-runner-by-name-or-id")}
|
inputAriaLabel={$_("search-for-runner-by-name-or-id")}
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
function selectOption(option) {
|
function selectOption(option) {
|
||||||
selected = option.value;
|
selected = option.value;
|
||||||
isOpen = false;
|
isOpen = false;
|
||||||
searchTerm = option.label;
|
searchTerm = option.label; // Set searchTerm to the selected option's label
|
||||||
focusedIndex = -1;
|
focusedIndex = -1;
|
||||||
dispatch("onSelected", option.value);
|
dispatch("onSelected", option.value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user