Jon/sky 6375 alter how show all code works (#3445)

This commit is contained in:
Jonathan Dobson
2025-09-16 16:32:15 -04:00
committed by GitHub
parent d57fccfaaf
commit f2146080ce
6 changed files with 273 additions and 172 deletions

View File

@@ -341,30 +341,21 @@ function Splitter({
const [isDragging, setIsDragging] = useState(false);
useMountEffect(() => {
// small delay here, to allow for arbitrary layout thrashing to settle;
// otherwise we have to rely on an observer for the container size, and
// resetting whenever the container resizes it likely incorrect behaviour
setTimeout(() => {
if (containerRef.current) {
const newPosition = normalizeUnitsToPercent(
containerRef,
direction,
firstSizingTarget,
firstSizing,
storageKey,
);
if (containerRef.current) {
const newPosition = normalizeUnitsToPercent(
containerRef,
direction,
firstSizingTarget,
firstSizing,
storageKey,
);
setSplitPosition(newPosition);
setSplitPosition(newPosition);
if (storageKey) {
setStoredSizing(
firstSizingTarget,
storageKey,
newPosition.toString(),
);
}
if (storageKey) {
setStoredSizing(firstSizingTarget, storageKey, newPosition.toString());
}
}, 100);
}
});
useOnChange(isDragging, (newValue, oldValue) => {