Fixed dragging with empty orphan favorites (#9205)

Created a resizable container tied to dragging state to create suitable
droppable zone when there's no orphan favorites.

Co-authored-by: Weiko <corentin@twenty.com>
This commit is contained in:
Lucas Bordeau
2024-12-23 15:57:09 +01:00
committed by GitHub
parent 3eff317b59
commit 74cf00a36d
2 changed files with 1 additions and 5 deletions

View File

@ -158,9 +158,6 @@ export const CurrentWorkspaceMemberFavorites = ({
ref={provided.innerRef}
// eslint-disable-next-line react/jsx-props-no-spreading
{...provided.droppableProps}
style={{
marginBottom: 15,
}}
// TODO: (Drag Drop Bug) Adding bottom margin to ensure drag-to-last-position works. Need to find better solution that doesn't affect spacing.
// Issue: Without margin, dragging to last position triggers next folder drop area
>

View File

@ -13,7 +13,6 @@ import { useLocation } from 'react-router-dom';
import { IconHeartOff } from 'twenty-ui';
const StyledEmptyContainer = styled.div`
height: ${({ theme }) => theme.spacing(2.5)};
width: 100%;
`;
@ -67,7 +66,7 @@ export const CurrentWorkspaceMemberOrphanFavorites = () => {
/>
))
) : (
<StyledEmptyContainer />
<StyledEmptyContainer style={{ height: isDragging ? '24px' : '1px' }} />
)}
</FavoritesDroppable>
);