Open jakerdy opened 7 months ago
If anyone is interested, there is a workaround:
const split = Split(..., {
minSize: 0,
onDrag: (sizes) => {
if (sizes[0] < 10) split.setSizes([10, 90]);
if (sizes[1] < 10) split.setSizes([90, 10]);
}, ...
All sizes are in percentages.
Hi, there is a problem with minSize. If
Split
created on hidden DOM node, this part of initialization logic at split.js @ 694, usesgetBoundingClientRect
. But if DOM nodes invisible at this moment (parent display:none) rect will be zero-sized, and minSize will be overwritten with 0 value. But obviously size is not === 0, it just invisible at the moment. When hiddenSplit
became visible, it will ignore specified minSizes.