@@ -13,7 +13,7 @@ class Popup extends Component {
13
13
style : PropTypes . object ,
14
14
getClassNameFromAlign : PropTypes . func ,
15
15
onAlign : PropTypes . func ,
16
- getRootDomNode : PropTypes . func ,
16
+ getTarget : PropTypes . func ,
17
17
onMouseEnter : PropTypes . func ,
18
18
align : PropTypes . any ,
19
19
destroyPopupOnHide : PropTypes . bool ,
@@ -61,7 +61,7 @@ class Popup extends Component {
61
61
62
62
// Record size if stretch needed
63
63
setStretchSize = ( ) => {
64
- const { stretch, getRootDomNode , visible } = this . props ;
64
+ const { stretch, getTarget , visible } = this . props ;
65
65
const { stretchChecked, targetHeight, targetWidth } = this . state ;
66
66
67
67
if ( ! stretch || ! visible ) {
@@ -71,7 +71,7 @@ class Popup extends Component {
71
71
return ;
72
72
}
73
73
74
- const $ele = getRootDomNode ( ) ;
74
+ const $ele = getTarget ( ) ;
75
75
if ( ! $ele ) return ;
76
76
77
77
const height = $ele . offsetHeight ;
@@ -90,10 +90,6 @@ class Popup extends Component {
90
90
return ReactDOM . findDOMNode ( this . popupInstance ) ;
91
91
}
92
92
93
- getTarget = ( ) => {
94
- return this . props . getRootDomNode ( ) ;
95
- }
96
-
97
93
getMaskTransitionName ( ) {
98
94
const props = this . props ;
99
95
let transitionName = props . maskTransitionName ;
@@ -166,6 +162,7 @@ class Popup extends Component {
166
162
ref : savePopupRef ,
167
163
onMouseEnter,
168
164
onMouseLeave,
165
+ getTarget,
169
166
style : newStyle ,
170
167
} ;
171
168
if ( destroyPopupOnHide ) {
@@ -178,7 +175,7 @@ class Popup extends Component {
178
175
>
179
176
{ visible ? (
180
177
< Align
181
- target = { this . getTarget }
178
+ target = { getTarget }
182
179
key = "popup"
183
180
ref = { this . saveAlignRef }
184
181
monitorWindowResize
@@ -205,7 +202,7 @@ class Popup extends Component {
205
202
showProp = "xVisible"
206
203
>
207
204
< Align
208
- target = { this . getTarget }
205
+ target = { getTarget }
209
206
key = "popup"
210
207
ref = { this . saveAlignRef }
211
208
monitorWindowResize
0 commit comments