Skip to content

Commit

Permalink
fix(list): fixes dragging nested list items (#7555)
Browse files Browse the repository at this point in the history
**Related Issue:** #7540

## Summary

- Fixes parent and nested lists from competing with each other and
setting dragEnabled on children
- Only closest parent will now set the dragEnabled property on its
direct children
- The furthest parent will control setting `selectionMode` and
`selectionAppearance` on all child items.
  • Loading branch information
driskull authored Aug 22, 2023
1 parent 1f753dd commit c25f7b3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/calcite-components/src/components/list/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,6 @@ export class List implements InteractiveComponent, LoadableComponent, SortableCo
const items = this.queryListItems(true);

items.forEach((item) => {
item.selectionAppearance = selectionAppearance;
item.selectionMode = selectionMode;
item.dragHandle = dragEnabled;
});

Expand All @@ -641,6 +639,9 @@ export class List implements InteractiveComponent, LoadableComponent, SortableCo
items.forEach((item) => {
item.selectionAppearance = selectionAppearance;
item.selectionMode = selectionMode;
});
const dragItems = this.queryListItems(true);
dragItems.forEach((item) => {
item.dragHandle = dragEnabled;
});
this.listItems = items;
Expand Down

0 comments on commit c25f7b3

Please sign in to comment.