From e16650d4a74f6bbf421cc26455104d5d4fe96fb9 Mon Sep 17 00:00:00 2001 From: Ankur Singh Chauhan Date: Mon, 7 Nov 2022 18:22:09 +0530 Subject: [PATCH] Bugfix/split line (#66) * Issue:62,fix Split line should have max squeeze limit * added limit to right pane also --- packages/bruno-app/src/components/RequestTabPanel/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/bruno-app/src/components/RequestTabPanel/index.js b/packages/bruno-app/src/components/RequestTabPanel/index.js index eb60c6ba..7b66be6f 100644 --- a/packages/bruno-app/src/components/RequestTabPanel/index.js +++ b/packages/bruno-app/src/components/RequestTabPanel/index.js @@ -16,6 +16,7 @@ import NetworkError from 'components/ResponsePane/NetworkError'; import StyledWrapper from './StyledWrapper'; const MIN_LEFT_PANE_WIDTH = 300; +const MIN_RIGHT_PANE_WIDTH = 350; const DEFAULT_PADDING = 5; const RequestTabPanel = () => { @@ -46,7 +47,11 @@ const RequestTabPanel = () => { const handleMouseMove = (e) => { if (dragging) { e.preventDefault(); - setLeftPaneWidth(Math.max((e.clientX - asideWidth - DEFAULT_PADDING), MIN_LEFT_PANE_WIDTH)); + let leftPaneXPosition = e.clientX + 2; + if (leftPaneXPosition < (asideWidth+ DEFAULT_PADDING + MIN_LEFT_PANE_WIDTH) || leftPaneXPosition > (screenWidth - MIN_RIGHT_PANE_WIDTH )) { + return; + } + setLeftPaneWidth(leftPaneXPosition- asideWidth); setRightPaneWidth(screenWidth - e.clientX - DEFAULT_PADDING); } };