Skip to content

Commit

Permalink
feat(Dropdown): update placement of nested levels to be side by side
Browse files Browse the repository at this point in the history
refs: CDS-70 CDS-182 (#213)
  • Loading branch information
beawar authored Aug 23, 2023
1 parent 81b0a31 commit f54dc35
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions src/components/display/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ function NestListItem({
className={selected ? 'zapp-selected' : ''}
orientation="horizontal"
mainAlignment="flex-start"
padding={{ vertical: 'small', horizontal: 'large' }}
style={{ cursor: onClick && !disabled ? 'pointer' : 'default' }}
onClick={disabled ? undefined : onClick}
tabIndex={disabled ? undefined : 0}
Expand All @@ -228,7 +227,11 @@ function NestListItem({
itemPaddingBetween={itemPaddingBetween}
dropdownListRef={dropdownListRef}
>
<Container orientation="horizontal" mainAlignment="flex-start">
<Container
orientation="horizontal"
mainAlignment="space-between"
padding={{ vertical: 'small', horizontal: 'large' }}
>
{customComponent || (
<ListItemContent
icon={icon}
Expand All @@ -241,11 +244,7 @@ function NestListItem({
tooltipLabel={tooltipLabel}
/>
)}
<Icon
size={itemIconSize}
icon="ChevronRight"
style={{ marginRight: 0, marginLeft: 'auto' }}
/>
<Icon size={itemIconSize} icon="ChevronRight" />
</Container>
</Dropdown>
</ContainerEl>
Expand All @@ -272,7 +271,6 @@ const PopperList = styled.div<{
box-shadow: 0 0 0.25rem 0 ${({ theme }): string => theme.palette.shadow.regular};
z-index: 999;
padding: ${({ theme }): string => theme.sizes.padding.small} 0;
max-width: ${({ width, maxWidth }): string => (width === '100%' ? '100%' : maxWidth)};
max-height: ${({ maxHeight }): string => maxHeight};
width: ${({ width, triggerRef }): string =>
Expand Down Expand Up @@ -578,14 +576,7 @@ const Dropdown = React.forwardRef<HTMLDivElement, DropdownProps>(function Dropdo
if (open) {
const popperOptions: OptionsGeneric<StrictModifiers> = {
placement,
modifiers: [
{
name: 'offset',
options: {
offset: (): [number, number] => [0, 4]
}
}
],
modifiers: [],
strategy: 'fixed'
};

Expand Down

0 comments on commit f54dc35

Please sign in to comment.