diff --git a/src/components/addresses/picker/AddressPicker.tsx b/src/components/addresses/picker/AddressPicker.tsx index 4b08d4f..7783f04 100644 --- a/src/components/addresses/picker/AddressPicker.tsx +++ b/src/components/addresses/picker/AddressPicker.tsx @@ -91,7 +91,8 @@ const hasExactAddress = !!cleanValue && !walletsOnly && isValidAddress(addressPrefix, cleanValue) - && !addressList.includes(cleanValue); + && !addressList.includes(cleanValue) + && !contactAddressList.includes(cleanValue); const exactAddressItem = hasExactAddress ? { ...getCategoryHeader(t("addressPicker.categoryExactAddress")), @@ -261,8 +262,8 @@ const inp = inputValue.toUpperCase(); const matchedAddress = address.indexOf(inp) !== -1; - const matchedLabel = walletLabel?.indexOf(inp) !== -1; - const matchedContactLabel = contactLabel?.indexOf(inp) !== -1; + const matchedLabel = walletLabel && walletLabel.indexOf(inp) !== -1; + const matchedContactLabel = contactLabel && contactLabel.indexOf(inp) !== -1; return matchedAddress || matchedLabel || matchedContactLabel; }} diff --git a/src/components/addresses/picker/Item.tsx b/src/components/addresses/picker/Item.tsx index 793deea..679d0c0 100644 --- a/src/components/addresses/picker/Item.tsx +++ b/src/components/addresses/picker/Item.tsx @@ -61,12 +61,14 @@ } /** Autocompletion option for the address picker. */ -export function getAddressItem(props: AddressItemProps): OptionValue { +export function getAddressItem(props: AddressItemProps, type?: string): OptionValue { // The address to use as a value const plainAddress = getPlainAddress(props); const { wallet, contact } = props; return { + key: `${type || "item"}-${plainAddress}`, + label: (