Skip to content

Commit

Permalink
stretch the divider to the height of parent
Browse files Browse the repository at this point in the history
  • Loading branch information
agneym committed Dec 16, 2019
1 parent 303b0e8 commit 4a9f024
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions playground/src/Draggable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
`;

Expand Down
2 changes: 1 addition & 1 deletion playground/src/Draggable/useDrag.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
}

Expand Down

0 comments on commit 4a9f024

Please sign in to comment.