Closed trusktr closed 1 year ago
resize panels while dragging
thanks for that feature
in my last commits i ...
SplitItem
layout:flex
, so with height:100%
we get wrong heights. instead, we must put all containers inside a "root" layout:flex
container and instead of height:100%
use flex-grow:1
. as "root" container, i added the component SplitRoot
props.resizeDebounce
for different resize strategies. for now the default is "live resize" (or "resize panels while dragging"). my plan is to use a debounced version of this as default, as currently, this is too wasteful. currently we resize at full speed (60 FPS or so), but we only need 10 FPS. by setting props.resizeDebounce
to 1/0
we get the resize strategy "live move only the handle, resize containers on mouseup"todo:
Continued from PR #6, relevant changes in commits 9a1a0d2 and 30aab4f. The other commits are from previous PRs.
If you merge this PR, it will merge all the other PRs too.
Summary
The magic begins! Namely,
Also
solid-styled-components
and add a 2-lineglobalStyle
function instead, reduce library sizeVerify
Switch to using
"solidjs-resizable-splitter-component": "file:../../",
indemo/src/package.json
to use the local version of the lib, thennpm run demo
.Now you should be able to resize panels and they will change size in real-time while dragging.