From 4f8f68c3d2ae99108b97befc5ab787873c7e3f77 Mon Sep 17 00:00:00 2001 From: Patrik Henningsson Date: Wed, 9 Mar 2022 17:07:05 +0100 Subject: [PATCH] feat: add prop for setting proportionalLayout (#179) --- src/allotment.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/allotment.tsx b/src/allotment.tsx index d0ae1411..032267cd 100644 --- a/src/allotment.tsx +++ b/src/allotment.tsx @@ -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 */ @@ -86,6 +88,7 @@ const Allotment = forwardRef( defaultSizes = sizes, snap = false, vertical = false, + proportionalLayout = true, onChange, onReset, }, @@ -141,6 +144,7 @@ const Allotment = forwardRef( const options: SplitViewOptions = { orientation: vertical ? Orientation.Vertical : Orientation.Horizontal, + proportionalLayout, ...(initializeSizes && defaultSizes && { descriptor: {