Open ArakTaiRoth opened 1 month ago
Because this component is a part of the component package, we are not able to update some other components that have been fixed, because it will break some key functionality in the app. The other component in the package that we are anxious to implement is the Chip component. Without the fix to the text overflow issue in the Chip component we have usability issues with a key part of our app's interface - please refer to the following screenshot.
@syedszeeshan could you take a look at this to see if the examples that you put together for the mount issue resolve this issue?
@ArakTaiRoth Investigate this issue if setting up random keys for each Dropdown item fixes the issue
@syedszeeshan could you take a look at this to see if the examples that you put together for the mount issue resolve this issue?
@Spark450
I tried this below
<goa-dropdown-item
*ngFor="
let item of itemsToAdd;
first as isFirst;
trackBy: generateUniqueKey
"
mount="{{ isFirst ? 'reset' : 'append' }}"
value="{{ item.id }}"
label="{{ item.id }}. {{ item.label }}"
></goa-dropdown-item>
alongwith this method
generateUniqueKey(index: number, item: Item): any {
return Math.random();
}
and, after the above change..... as you select an item, it gets removed from the first dropdown and shows up in the added items list. Resetting brings everything back to how it was initially.
Closing as both me and Syed were able to resolve the issue, this my Stackblitz link with the issue resolved, https://stackblitz.com/edit/stackblitz-starters-rv7zkz?file=src%2Fdynamic-dropdown-t[…]%2Fdynamic-dropdown-test%2Fdynamic-dropdown-test.component.ts
Re-opening this issue, as there is still an issue present. This is detailed in the edited issue above.
Info
Reported by Francis Agyapong
Removing items generally works dynamically from the dropdown using the unique key idea raised earlier. However, it seems impossible to remove the final item from the Dropdown.
You can see the issue on this Stackblitz.
If that link is dead, here is the code for Angular:
More Info
There are a couple problems with what's shown in the above Stackblitz. It isn't using the latest version (the problem exists if you update the version). It's not using Reactive Forms (I'm not sure if that makes a difference [it shouldn't]).
Acceptance Criteria