Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 修复元素加载 input autoFocus 会滚动页面顶部问题 #317

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/Popup/PopupInner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const PopupInner = React.forwardRef<PopupInnerRef, PopupInnerProps>(
* We will reset `alignTimes` for each status switch to `alignPre`
* and let `rc-align` to align for multiple times to ensure get final stable place.
* Currently we mark `alignTimes < 2` repeat align, it will increase if user report for align issue.
*
*
* Update:
* In React 18. `rc-align` effect of align may faster than ref called trigger `forceAlign`.
* We adjust this to `alignTimes < 2`.
Expand Down Expand Up @@ -206,6 +206,8 @@ const PopupInner = React.forwardRef<PopupInnerRef, PopupInnerProps>(
// Cannot interact with disappearing elements
// https://github.com/ant-design/ant-design/issues/35051#issuecomment-1101340714
pointerEvents: !visible && status !== 'stable' ? 'none' : undefined,
position: 'absolute',
top: document.documentElement.scrollTop,
...style,
};

Expand Down