fix: hidden BackTop still effect layout, such as cursor

This commit is contained in:
jesse 2020-06-20 16:02:16 +08:00
parent 35f1b1b7fc
commit 9000e15a2d
2 changed files with 11 additions and 4 deletions

View File

@ -98,6 +98,7 @@ const BackTop: React.FC<BackTopProps> = props => {
const prefixCls = getPrefixCls('back-top', customizePrefixCls);
const classString = classNames(prefixCls, className, {
[`${prefixCls}-rtl`]: direction === 'rtl',
[`${prefixCls}-visible`]: getVisible(),
});
// fix https://fb.me/react-unknown-prop

View File

@ -9,10 +9,16 @@
position: fixed;
right: 100px;
bottom: 50px;
z-index: @zindex-back-top;
width: 40px;
height: 40px;
cursor: pointer;
width: 0;
height: 0;
z-index: -999;
&-visible {
width: 40px;
height: 40px;
z-index: @zindex-back-top;
cursor: pointer;
}
&-rtl {
right: auto;