diff --git a/src/components/donations/AddDonationModal.svelte b/src/components/donations/AddDonationModal.svelte index f8b5f766..234b0f42 100644 --- a/src/components/donations/AddDonationModal.svelte +++ b/src/components/donations/AddDonationModal.svelte @@ -13,7 +13,9 @@ export let current_donations; const getDonorLabel = (option) => option.firstname + " " + (option.middlename || "") + " " + option.lastname; - const filterDonors = (label, filterText, option) => (label.toLowerCase().includes(filterText.toLowerCase()) || option.id.toString().startsWith(filterText.toLowerCase())); + const filterDonors = (label, filterText, option) => + label.toLowerCase().includes(filterText.toLowerCase()) || + option.id.toString().startsWith(filterText.toLowerCase()); function focus(el) { el.focus(); } @@ -209,15 +211,16 @@ - getDonorLabel(option)} + getOptionLabel={(option) => getDonorLabel(option)} + itemFilter={(label, filterText, option) => filterDonors(label, filterText, option)} + items={donors} + showChevron={true} + placeholder={$_('search-for-donor-name-or-id')} + noOptionsMessage={$_('no-donors-found')} + on:select={(selectedValue) => (donor = selectedValue.detail.id)} /> {#if !is_fixed}