@@ -6,7 +6,7 @@ import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
66import { composeRef } from 'rc-util/lib/ref' ;
77import * as React from 'react' ;
88import type { TriggerProps } from '../' ;
9- import type { AlignType , ArrowType } from '../interface' ;
9+ import type { AlignType , ArrowPos , ArrowTypeOuter } from '../interface' ;
1010import Arrow from './Arrow' ;
1111import Mask from './Mask' ;
1212import PopupContent from './PopupContent' ;
@@ -26,7 +26,8 @@ export interface PopupProps {
2626
2727 // Arrow
2828 align ?: AlignType ;
29- arrow ?: ArrowType ;
29+ arrow ?: ArrowTypeOuter ;
30+ arrowPos : ArrowPos ;
3031
3132 // Open
3233 open : boolean ;
@@ -81,6 +82,7 @@ const Popup = React.forwardRef<HTMLDivElement, PopupProps>((props, ref) => {
8182
8283 // Arrow
8384 arrow,
85+ arrowPos,
8486 align,
8587
8688 // Motion
@@ -206,14 +208,18 @@ const Popup = React.forwardRef<HTMLDivElement, PopupProps>((props, ref) => {
206208 < div
207209 ref = { composeRef ( resizeObserverRef , ref , motionRef ) }
208210 className = { cls }
209- style = { {
210- ...offsetStyle ,
211- ...miscStyle ,
212- ...motionStyle ,
213- boxSizing : 'border-box' ,
214- zIndex,
215- ...style ,
216- } }
211+ style = {
212+ {
213+ '--arrow-x' : `${ arrowPos . x || 0 } px` ,
214+ '--arrow-y' : `${ arrowPos . y || 0 } px` ,
215+ ...offsetStyle ,
216+ ...miscStyle ,
217+ ...motionStyle ,
218+ boxSizing : 'border-box' ,
219+ zIndex,
220+ ...style ,
221+ } as React . CSSProperties
222+ }
217223 onMouseEnter = { onMouseEnter }
218224 onMouseLeave = { onMouseLeave }
219225 onClick = { onClick }
@@ -222,6 +228,7 @@ const Popup = React.forwardRef<HTMLDivElement, PopupProps>((props, ref) => {
222228 < Arrow
223229 prefixCls = { prefixCls }
224230 arrow = { arrow }
231+ arrowPos = { arrowPos }
225232 align = { align }
226233 />
227234 ) }
0 commit comments