fix: width blink in side bar (#5291)

This commit is contained in:
Peng Xiao
2023-12-14 09:20:18 +00:00
parent c66781970b
commit 63de73a815

View File

@@ -149,12 +149,13 @@ export const ResizePanel = forwardRef<HTMLDivElement, ResizePanelProps>(
ref
) {
const enableAnimation = useEnableAnimation() && _enableAnimation;
const safeWidth = Math.min(maxWidth, Math.max(minWidth, width));
return (
<div
{...rest}
ref={ref}
style={assignInlineVars({
[styles.panelWidthVar]: `${width}px`,
[styles.panelWidthVar]: `${safeWidth}px`,
})}
className={clsx(className, styles.root)}
data-open={open}