-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
This behavior has been observed when we are selecting a option
which are present in two different groups, The Pills are shown twice.
Engineering Notes:
The issue lies in the logic for filtering and creating pills in the multi-select component. The duplicate selection occurs because duplicate values in the input array are not handled.
Current implementation:
// Create new pills.
const pillsToCreate: string[] = values.filter( ( value: string ) => ! pillValues.includes( value ) );
Proposed fix:
// Create new pills.
const pillsToCreate: string[] = Array.from(new Set(values)) // Ensure Unique values.
.filter( ( value: string ) => ! pillValues.includes( value ) );
Impacted File
web-components/src/multi-select/tp-multi-select-pills.ts
Metadata
Metadata
Assignees
Labels
No labels