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(popup): fix ref types #2577

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Changes from all 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
10 changes: 7 additions & 3 deletions src/popup/Popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ export interface PopupProps extends TdPopupProps {
}

export interface PopupRef {
// 获取popper实例
/** 获取 popper 实例 */
getPopper: () => ReturnType<typeof usePopper>;
// 获取Popup dom元素
/** 获取 Popup dom 元素 */
getPopupElement: () => HTMLDivElement;
// 获取portal dom元素
/** 获取 portal dom 元素 */
getPortalElement: () => HTMLDivElement;
/** 获取内容区域 dom 元素 */
getPopupContentElement: () => HTMLDivElement;
/** 设置 popup 显示隐藏 */
setVisible: (visible: boolean) => void;
}

const Popup = forwardRef<PopupRef, PopupProps>((originalProps, ref) => {
Expand Down
Loading