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

Commit

Permalink
fix(action): Add slotChildNodesFix to stencil config extras (#890)
Browse files Browse the repository at this point in the history
* add extra to config for default slot info

* update to check for slot length

* getSlotted cleanup
  • Loading branch information
driskull authored Mar 25, 2020
1 parent f8c6222 commit 99717d3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/calcite-action/calcite-action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export class CalciteAction {
const calciteLoaderNode = loading ? <calcite-loader is-active inline /> : null;
const calciteIconNode = icon ? <calcite-icon icon={icon} scale={iconScale} /> : null;
const iconNode = calciteLoaderNode || calciteIconNode;
const hasIconToDisplay = iconNode || el.querySelector("calcite-icon, svg");
const hasIconToDisplay = iconNode || el.children?.length;

const slotContainerNode = (
<div
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-flow-item/calcite-flow-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export class CalciteFlowItem {
}

renderFab(): VNode {
const hasFab = this.el.querySelector(`[slot=${SLOTS.fab}]`);
const hasFab = getSlotted(this.el, SLOTS.fab);
return hasFab ? (
<div class={CSS.fabContainer} slot={PANEL_SLOTS.fab}>
<slot name={SLOTS.fab} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/calcite-panel/calcite-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ export class CalcitePanel {
}

renderFab(): VNode {
const hasFab = this.el.querySelector(`[slot=${SLOTS.fab}]`);
const hasFab = getSlotted(this.el, SLOTS.fab);

return hasFab ? (
<div class={CSS.fabContainer}>
Expand Down
3 changes: 2 additions & 1 deletion stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export const create: () => Config = () => ({
excludeSrc: DEFAULT_EXCLUDE_SRC,
srcIndexHtml: "src/index.html",
extras: {
appendChildSlotFix: true
appendChildSlotFix: true,
slotChildNodesFix: true
}
});

Expand Down

0 comments on commit 99717d3

Please sign in to comment.