Improve maxHeight

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2020-09-24 09:34:19 +01:00
parent 956a3bf69d
commit f3e6f43c3d
1 changed files with 2 additions and 2 deletions

View File

@ -35,7 +35,7 @@ interface IProps {
}
const MIN_HEIGHT = 100;
const MAX_HEIGHT = 500;
const MAX_HEIGHT = 500; // or 50% of the window height
const INITIAL_HEIGHT = 280;
const LeftPanelWidget: React.FC<IProps> = ({ onResize }) => {
@ -85,7 +85,7 @@ const LeftPanelWidget: React.FC<IProps> = ({ onResize }) => {
content = <Resizable
size={{height} as any}
minHeight={MIN_HEIGHT}
maxHeight={MAX_HEIGHT}
maxHeight={Math.min(window.innerHeight / 2, MAX_HEIGHT)}
onResize={onResize}
onResizeStop={(e, dir, ref, d) => {
setHeight(height + d.height);