Skip to content

Commit

Permalink
fix(action-pad): update layout on action-group elements slotted after…
Browse files Browse the repository at this point in the history
… initialization. #10353
  • Loading branch information
driskull committed Sep 19, 2024
1 parent 6f42a86 commit 3c1f77e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,18 @@ describe("calcite-action-bar", () => {
await page.waitForChanges();

expect(await group.getProperty("layout")).toBe("vertical");

actionBar.innerHTML = html`
<calcite-action-group></calcite-action-group>
<calcite-action-group></calcite-action-group>
`;
await page.waitForChanges();

const groups = await page.findAll("calcite-action-group");

groups.forEach(async (group) => {
expect(await group.getProperty("layout")).toBe("vertical");
});
});

describe("theme", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,18 @@ describe("calcite-action-pad", () => {
await page.waitForChanges();

expect(await group.getProperty("layout")).toBe("vertical");

actionPad.innerHTML = html`
<calcite-action-group></calcite-action-group>
<calcite-action-group></calcite-action-group>
`;
await page.waitForChanges();

const groups = await page.findAll("calcite-action-group");

groups.forEach(async (group) => {
expect(await group.getProperty("layout")).toBe("vertical");
});
});

describe("theme", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,14 @@ export class ActionPad
connectConditionalSlotComponent(this);
connectLocalized(this);
connectMessages(this);
this.mutationObserver?.observe(this.el, { childList: true, subtree: true });
}

disconnectedCallback(): void {
disconnectLocalized(this);
disconnectMessages(this);
disconnectConditionalSlotComponent(this);
this.mutationObserver?.disconnect();
}

async componentWillLoad(): Promise<void> {
Expand Down

0 comments on commit 3c1f77e

Please sign in to comment.