I have made a draggable split panel by https://github.com/johnwalley/allotment.
At the moment, when we drag up the split bar, the first allotment pane does not scroll. I would like to scroll the first allotment pane whenever we move up the split bar. Does anyone know how to do that?
https://codesandbox.io/s/reset-forked-u6qf4p?file=/src/App.js
import React from "react";
import { Allotment } from "allotment";
import "allotment/dist/style.css";
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
toExpand: true
};
this.myRef = React.createRef();
}
handleChange = (sizes) => {
if (sizes.length > 1) {
if (sizes[1] < 31) {
this.setState({ toExpand: true });
} else {
this.setState({ toExpand: false });
}
}
};
render() {
return (
<div
style={{
minWidth: 200,
height: "100vh",
overflowX: "auto",
width: "auto",
margin: "0px 0px 0px 0px"
}}
>
<Allotment
vertical
onChange={this.handleChangeAllotment}
ref={this.myRef}
>
<Allotment.Pane>
long <br /> long <br /> long <br />
long <br /> long <br /> long <br />
long <br /> long <br /> long <br />
long <br /> long <br /> long <br />
</Allotment.Pane>
<Allotment.Pane preferredSize="0%" minSize={20}>
short <br /> short <br />
short <br /> short <br />
short <br /> short <br />
short <br /> short <br />
short <br /> short <br />
short <br /> short <br />
</Allotment.Pane>
</Allotment>
</div>
);
}
}