You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
当监听区域不设置高度时(父容器高度由子容器自动撑开)
`
import React from 'react';
import { Anchor } from 'antd';
const { Link } = Anchor;
import '../../scss/test1.css';
const Test1: React.FC<{}> = () => {
}
export default Test1;
`
`
@import 'antd/dist/antd.css';
.code-box-demo .ant-affix {
z-index: 11;
}
#aaaa div {
height: 500px;
margin: 20px;
background-color: pink;
}
#aaaa{
overflow-y: auto;
}
`
我不想写死高度,因为那样的话可维护性和迭代性都会很差,我也想知道产生这个问题的原因是什么。如果使用react-anchor-scroll-detect这个插件的话就没有这个问题,所以我个人觉得可能是底层获取距离顶部高度时发生了问题,但是我没找到原因。
Beta Was this translation helpful? Give feedback.
All reactions