feat: TooltipRef export popup element (#49230)

This commit is contained in:
nuintun 2025-01-23 22:54:30 +08:00 committed by GitHub
parent 3934566134
commit cad00f1a25
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,6 +34,8 @@ export interface TooltipRef {
forceAlign: VoidFunction;
/** Wrapped dom element. Not promise valid if child not support ref */
nativeElement: HTMLElement;
/** Popup dom element */
popupElement: HTMLDivElement;
}
export type TooltipPlacement =
@ -179,6 +181,7 @@ const InternalTooltip = React.forwardRef<TooltipRef, TooltipProps>((props, ref)
forceAlign();
},
nativeElement: tooltipRef.current?.nativeElement!,
popupElement: tooltipRef.current?.popupElement!,
}));
// ============================== Warn ==============================