Skip to content

Commit

Permalink
fix(shell-panel): click events correctly pass through the host element (
Browse files Browse the repository at this point in the history
#3607)

* fix(shell-panel): click events correctly  pass through the shell-panel host

* add test
  • Loading branch information
benelan authored Dec 1, 2021
1 parent 90639f6 commit fbada5e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
16 changes: 16 additions & 0 deletions src/components/calcite-shell-panel/calcite-shell-panel.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,4 +386,20 @@ describe("calcite-shell-panel", () => {
expect(separator.getAttribute("aria-valuenow")).toBe("330");
expect((await content.getComputedStyle()).width).toBe("330px");
});

it("click event should pass through host element", async () => {
const page = await newE2EPage();
await page.setContent(
`<calcite-shell content-behind>
<calcite-shell-panel slot="primary-panel" position="start" detached></calcite-shell-panel>
<calcite-action text="test" style="height: 100%; width: 100%;" text-enabled></calcite-action>
</calcite-shell>`
);

await page.waitForChanges();
const shellPanel = await page.find("calcite-shell-panel");
await shellPanel.click();
await page.waitForChanges();
expect(await page.evaluate((selector) => document.activeElement.matches(selector), "calcite-action")).toBe(true);
});
});
3 changes: 2 additions & 1 deletion src/components/calcite-shell-panel/calcite-shell-panel.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
:host {
@apply flex
items-stretch
flex-initial;
flex-initial
pointer-events-none;
--calcite-shell-panel-detached-max-height: unset;
}

Expand Down

0 comments on commit fbada5e

Please sign in to comment.