diff --git a/playground/src/Draggable/index.tsx b/playground/src/Draggable/index.tsx index ccf2988..1601bf1 100644 --- a/playground/src/Draggable/index.tsx +++ b/playground/src/Draggable/index.tsx @@ -4,13 +4,13 @@ import useDrag from "./useDrag"; const Container = styled.div` display: flex; + align-items: stretch; `; -const DIVIDER_WIDTH = 5; +const DIVIDER_WIDTH = 3; const Divider = styled.div` width: ${DIVIDER_WIDTH}px; - height: 20rem; cursor: col-resize; `; diff --git a/playground/src/Draggable/useDrag.ts b/playground/src/Draggable/useDrag.ts index 520b079..de2b142 100644 --- a/playground/src/Draggable/useDrag.ts +++ b/playground/src/Draggable/useDrag.ts @@ -50,7 +50,7 @@ function useDrag({ containerRef, dividerRef, dividerWidth }: IProps) { return { leftWidth: width, - rightWidth: containerRect ? containerRect.width - width : 0, + rightWidth: containerRect ? containerRect.width - width - dividerWidth : 0, }; }