Open PlusA2M opened 1 year ago
I've experiencing issue Error: Cannot have duplicate keys in a keyed each in the situation that the data for the search function will be update after user's interaction.
Error: Cannot have duplicate keys in a keyed each
function searchFromData(keyword: string) { return data.filter((m) => m.phone?.includes(keyword)) // return { id: string, phone: string} }
labelFieldName="phone" keywordsFieldName="phone" valueFieldName="id" sortByMatchedKeywords="true"
Not knowing the whole lifecycle of the simple-svelte-autocomplete, I've added the timestamp to avoid that as a temporary hot fix.
simple-svelte-autocomplete
{@const now = Date.now()} {#each selectedItem as tagItem, i (`${valueFunction(tagItem, true)}-${now}`)}
I've experiencing issue
Error: Cannot have duplicate keys in a keyed each
in the situation that the data for the search function will be update after user's interaction.Search function
Key attribute settings
Hotfix on SimpleAutoComplete.svelte
Not knowing the whole lifecycle of the
simple-svelte-autocomplete
, I've added the timestamp to avoid that as a temporary hot fix.