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 (#10355)

**Related Issue:** #10353

## Summary

- update layout on action-group elements slotted after initialization
- add test
  • Loading branch information
driskull authored Sep 20, 2024
1 parent 4160af1 commit cf139fa
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 cf139fa

Please sign in to comment.