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

Commit

Permalink
fix(action-bar): removed default return from getCalcitePosition
Browse files Browse the repository at this point in the history
* removed default return from getCalcitePosition
* Updated getClosestShellPosition
  • Loading branch information
asangma committed Feb 28, 2020
1 parent 1436195 commit 5a1fa28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions src/components/utils/CalciteExpandToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ const ICONS = {

function getClosestShellPosition(el: HTMLElement): CalcitePosition | null {
const shellNode = el.closest("calcite-shell-panel");

if (!shellNode) {
return;
}

return shellNode.position;
if (shellNode.position) {
return shellNode.position;
}
if (shellNode.layout) {
return shellNode.layout === "trailing" ? "end" : "start";
}
}

function getCalcitePosition(position: CalcitePosition, el: HTMLElement) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/utils/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export function getCalcitePosition(position: CalcitePosition, layout: CalciteLay
if (layout) {
return layout === "trailing" ? "end" : "start";
}

return "start";
}

export function getSlotted<T extends Element = Element>(element: Element, slotName: string): T[] {
Expand Down

0 comments on commit 5a1fa28

Please sign in to comment.