Skip to content

Commit

Permalink
fix(DropDown): fix incorrect borders
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulo Lagoá committed Apr 13, 2023
1 parent 5b3ca23 commit f8868ee
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
13 changes: 11 additions & 2 deletions packages/core/src/components/BaseDropdown/BaseDropdown.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,16 @@ export const StyledExtension = styled(
})
);

export const StyledPanel = styled("div")({
export const StyledPanel = styled(
"div",
transientOptions
)(({ $popperPlacement }: { $popperPlacement: string }) => ({
position: "relative",
boxShadow: theme.baseDropdown.shadow,
});
...($popperPlacement === "top" && {
top: "1px",
}),
...($popperPlacement === "bottom" && {
top: "-1px",
}),
}));
3 changes: 3 additions & 0 deletions packages/core/src/components/BaseDropdown/BaseDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,9 @@ export const HvBaseDropdown = ({
<StyledPanel
id={setId(elementId, "children-container")}
className={clsx(baseDropdownClasses.panel, classes?.panel)}
$popperPlacement={
popperPlacement.includes("top") ? "top" : "bottom"
}
>
{children}
</StyledPanel>
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/components/Dropdown/List/List.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export const StyledRootList = styled("div")({
width: "100%",
backgroundColor: theme.dropdown.listBackgroundColor,
border: theme.dropdown.listBorder,
borderTop: "none",
borderRadius: theme.dropdown.listBorderRadius,
});

Expand Down

0 comments on commit f8868ee

Please sign in to comment.