Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(list): Stop emitting calciteListChange when a list-item is disabled or closed. #7624

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading