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:
@ -158,9 +158,6 @@ export const CurrentWorkspaceMemberFavorites = ({
|
|||||||
ref={provided.innerRef}
|
ref={provided.innerRef}
|
||||||
// eslint-disable-next-line react/jsx-props-no-spreading
|
// eslint-disable-next-line react/jsx-props-no-spreading
|
||||||
{...provided.droppableProps}
|
{...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.
|
// 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
|
// Issue: Without margin, dragging to last position triggers next folder drop area
|
||||||
>
|
>
|
||||||
|
|||||||
@ -13,7 +13,6 @@ import { useLocation } from 'react-router-dom';
|
|||||||
import { IconHeartOff } from 'twenty-ui';
|
import { IconHeartOff } from 'twenty-ui';
|
||||||
|
|
||||||
const StyledEmptyContainer = styled.div`
|
const StyledEmptyContainer = styled.div`
|
||||||
height: ${({ theme }) => theme.spacing(2.5)};
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
@ -67,7 +66,7 @@ export const CurrentWorkspaceMemberOrphanFavorites = () => {
|
|||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<StyledEmptyContainer />
|
<StyledEmptyContainer style={{ height: isDragging ? '24px' : '1px' }} />
|
||||||
)}
|
)}
|
||||||
</FavoritesDroppable>
|
</FavoritesDroppable>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user