Skip to content

Commit

Permalink
fix(list): Stop emitting calciteListChange when a list-item is disabl…
Browse files Browse the repository at this point in the history
…ed or closed. (#7624)

**Related Issue:** #7627

## Summary

- calciteListChange shouldn't be emitting when an item is disabled or
closed.
  • Loading branch information
driskull authored Aug 31, 2023
1 parent 79c3d56 commit 7008463
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/calcite-components/src/components/list/list.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,12 @@ describe("calcite-list", () => {

expect(await isElementFocused(page, "#two")).toBe(true);

const calciteListChange = await page.spyOnEvent("calciteListChange");
const listItemThree = await page.find("#three");
listItemThree.setProperty("disabled", false);
await page.waitForChanges();
await page.waitForTimeout(listDebounceTimeout);
expect(calciteListChange).toHaveReceivedEventTimes(0);

await list.press("ArrowDown");

Expand All @@ -404,6 +406,7 @@ describe("calcite-list", () => {
listItemFour.setProperty("closed", false);
await page.waitForChanges();
await page.waitForTimeout(listDebounceTimeout);
expect(calciteListChange).toHaveReceivedEventTimes(0);

await list.press("ArrowDown");

Expand Down
2 changes: 1 addition & 1 deletion packages/calcite-components/src/components/list/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export class List implements InteractiveComponent, LoadableComponent, SortableCo
}

event.stopPropagation();
this.updateListItems(true);
this.updateListItems();
}

@Listen("calciteInternalListItemGroupDefaultSlotChange")
Expand Down

0 comments on commit 7008463

Please sign in to comment.