I successfully implemented a draggable split panel using a code library from johnwalley on GitHub called https://github.com/johnwalley/allotment.
My goal is to achieve the following functionalities:
- Clicking on
should expand or collapse the allotment B accordingly.Expand or collapse the allotment B
- We should be able to drag the splitter and save its position before collapsing the allotment B, ensuring that we can return to that position when expanding the allotment B.
- When initially expanding the allotment B, I want its height to be set at 1/5 of the total height.
I have written the relevant code here: (https://codesandbox.io/s/reset-forked-f2f386?file=/src/App.js). However, I am facing difficulty in achieving points 2) and 3) simultaneously.
If anyone has any insights as to why this could be happening, please let me know!
import React from "react";
import { Allotment } from "allotment";
import "allotment/dist/style.css";
import "./style.css";
// App component logic goes here