fix: double click to reset sidebar size

This commit is contained in:
EnixCoda 2021-12-23 12:45:45 +08:00
parent 73f9a8fcbe
commit 86a030f308

View file

@ -104,7 +104,10 @@ export function SideBarBodyWrapper({
{features.resize && (
<HorizontalResizeHandler
onResize={onResize}
onResetSize={() => setSize(defaultConfigs.sideBarWidth)}
onResetSize={() => {
setSize(defaultConfigs.sideBarWidth)
apply(sizeVariableMountPoint, defaultConfigs.sideBarWidth)
}}
onResizeStateChange={state => {
blockLeaveRef.current = state === 'resizing'
}}