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 ref
) { ) {
const enableAnimation = useEnableAnimation() && _enableAnimation; const enableAnimation = useEnableAnimation() && _enableAnimation;
const safeWidth = Math.min(maxWidth, Math.max(minWidth, width));
return ( return (
<div <div
{...rest} {...rest}
ref={ref} ref={ref}
style={assignInlineVars({ style={assignInlineVars({
[styles.panelWidthVar]: `${width}px`, [styles.panelWidthVar]: `${safeWidth}px`,
})} })}
className={clsx(className, styles.root)} className={clsx(className, styles.root)}
data-open={open} data-open={open}