Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions packages/components/popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,26 @@ const Popup = forwardRef<PopupInstanceFunctions, PopupProps>((originalProps, ref
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible, content, windowHeight, windowWidth]);

// 下拉展开时更新内部滚动条和箭头位置
// 下拉展开或内容变化时,调整箭头位置
useEffect(() => {
if (visible && popupElement && contentRef.current) {
requestAnimationFrame(() => {
updateScrollTop?.(contentRef.current);
updateArrowPosition();
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible, content, popupElement]);

// 下拉展开时,触发滚动回调
useEffect(() => {
if (visible && popupElement && contentRef.current) {
requestAnimationFrame(() => {
updateScrollTop?.(contentRef.current);
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [visible, popupElement]);

function handleExited() {
setIsOverlayHover(false);
if (!destroyOnClose && popupElement) popupElement.style.display = 'none';
Expand Down
4 changes: 1 addition & 3 deletions packages/tdesign-react/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ spline: explain

### 🐞 Bug Fixes

- `Cascader`:
- 修复在弹出层可见期间,滚动位置被意外更新的问题 @RylanBot ([#4062](https://github.com/Tencent/tdesign-react/pull/4062))
- 优化 Safari 浏览器中点击展开图标没有变换方向的问题 @liweijie0812 ([#4056](https://github.com/Tencent/tdesign-react/pull/4056))
- `Cascader`: 优化 Safari 浏览器中点击展开图标没有变换方向的问题 @liweijie0812 ([#4056](https://github.com/Tencent/tdesign-react/pull/4056))
- `Dialog`:
- 修复 `closeOnOverlayClick` 为 `false` 时,`onOverlayClick` 无法触发的问题 @TidySongS ([#4065](https://github.com/Tencent/tdesign-react/pull/4065))
- 修复 `mode="modeless"` 的弹窗,点击空白地方会被关闭的问题 @RylanBot ([#3950](https://github.com/Tencent/tdesign-react/pull/3950))
Expand Down
Loading