Skip to content
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

feat(Dropdown): update placement of nested levels to be side by side #213

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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