Bugfix/split line (#66)

* Issue:62,fix Split line should have max squeeze limit
* added limit to right pane also
This commit is contained in:
Ankur Singh Chauhan 2022-11-07 18:22:09 +05:30 committed by GitHub
parent 62ed489847
commit e16650d4a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}
};