Fix incorrect collapse icon position when sider in the right

This commit is contained in:
ztplz 2019-01-21 12:12:33 +08:00 committed by 偏右
parent 4c5f3d2b0a
commit c24d737546
2 changed files with 12 additions and 1 deletions

View File

@ -213,7 +213,10 @@ class Sider extends React.Component<SiderProps, SiderState> {
// special trigger when collapsedWidth == 0
const zeroWidthTrigger =
parseFloat(String(collapsedWidth || 0)) === 0 ? (
<span onClick={this.toggle} className={`${prefixCls}-zero-width-trigger`}>
<span
onClick={this.toggle}
className={`${prefixCls}-zero-width-trigger-${reverseArrow ? 'right' : 'left'}`}
>
<Icon type="bars" />
</span>
) : null;

View File

@ -110,6 +110,14 @@
&:hover {
background: tint(@layout-sider-background, 10%);
}
&-left {
right: -@layout-zero-trigger-width;
}
&-right {
left: -@layout-zero-trigger-width;
}
}
}
}