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">
|
||||
<p class="text-black">
|
||||
{$_("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
|
||||
)}
|
||||
</p>
|
||||
@ -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")}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user