-
Notifications
You must be signed in to change notification settings - Fork 80
fix(shell): update shell to correctly position calcite shell panel at shell's bottom #9748
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6ab25df
6074398
02936a8
cda472e
5794d29
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,6 +193,13 @@ export class Shell implements ConditionalSlotComponent { | |
|
||
const contentContainerKey = "content-container"; | ||
|
||
const shellPanels: Array<HTMLCalciteShellPanelElement> = Array.from( | ||
this.el.querySelectorAll("calcite-shell-panel"), | ||
); | ||
const hasOnlyBottomPanel: boolean = !!( | ||
shellPanels.length === 1 && shellPanels.find((element) => element.slot === "panel-bottom") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixme: Instead, use an There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @driskull I updated the logic to use |
||
); | ||
|
||
const content = this.contentBehind | ||
? [ | ||
<div | ||
|
@@ -204,14 +211,22 @@ export class Shell implements ConditionalSlotComponent { | |
> | ||
{defaultSlotContainerNode} | ||
</div>, | ||
<div class={CSS.contentBehindCenterContent}> | ||
<div | ||
class={{ | ||
[CSS.contentBehindCenterContent]: true, | ||
[CSS.contentBottom]: hasOnlyBottomPanel, | ||
}} | ||
> | ||
{panelTopSlotNode} | ||
{panelBottomSlotNode} | ||
{deprecatedCenterRowSlotNode} | ||
</div>, | ||
] | ||
: [ | ||
<div class={CSS.content} key={contentContainerKey}> | ||
<div | ||
class={{ [CSS.content]: true, [CSS.contentBottom]: hasOnlyBottomPanel }} | ||
key={contentContainerKey} | ||
> | ||
{panelTopSlotNode} | ||
{defaultSlotContainerNode} | ||
{panelBottomSlotNode} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixme: This would't work in cases when shell-panels are slotted in after the shell has been initialized. Instead, an
onSlotChange
should be used to find shell-panels.