Skip to content

Commit

Permalink
feat: add prop for setting proportionalLayout (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen authored Mar 9, 2022
1 parent 31074af commit 4f8f68c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/allotment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ export type AllotmentProps = {
sizes?: number[];
/** Direction to split */
vertical?: boolean;
/** Resize each view proportionally when resizing container */
proportionalLayout?: boolean,
/** Callback on drag */
onChange?: (sizes: number[]) => void;
/** Callback on reset */
Expand All @@ -86,6 +88,7 @@ const Allotment = forwardRef<AllotmentHandle, AllotmentProps>(
defaultSizes = sizes,
snap = false,
vertical = false,
proportionalLayout = true,
onChange,
onReset,
},
Expand Down Expand Up @@ -141,6 +144,7 @@ const Allotment = forwardRef<AllotmentHandle, AllotmentProps>(

const options: SplitViewOptions = {
orientation: vertical ? Orientation.Vertical : Orientation.Horizontal,
proportionalLayout,
...(initializeSizes &&
defaultSizes && {
descriptor: {
Expand Down

0 comments on commit 4f8f68c

Please sign in to comment.