Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
Added test for leading-actions slot. (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
asangma committed May 11, 2020
1 parent 722d2fe commit a7f2ea0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/calcite-flow-item/calcite-flow-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,12 @@ export class CalciteFlowItem {
}

renderHeaderLeadingContent(): VNode {
// const content = getSlotted(this.el, SLOTS.leadingActions, {all: true });
return (
const hasLeadingActions = getSlotted(this.el, SLOTS.leadingActions);
return hasLeadingActions ? (
<div slot={PANEL_SLOTS.headerLeadingContent} class="leading-actions">
<slot name={SLOTS.leadingActions}></slot>
</div>
);
) : null;
}

renderHeaderActions(): VNode {
Expand Down
6 changes: 6 additions & 0 deletions src/demos/flow/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ <h2>Basic</h2>
<img src="https://via.placeholder.com/400x300" alt="placeholder" />
<calcite-fab slot="fab"></calcite-fab>
</calcite-flow-item>
<calcite-flow-item heading="Item Three">
<button slot="menu-actions">Reset</button>
<button slot="menu-actions">Rename</button>
<img src="https://via.placeholder.com/400x300" alt="placeholder" />
<calcite-fab slot="fab"></calcite-fab>
</calcite-flow-item>
</calcite-flow>

<h2>Menu-actions and Footer-actions</h2>
Expand Down

0 comments on commit a7f2ea0

Please sign in to comment.