File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ const TimePicker = {
83
83
prop : 'value' ,
84
84
event : 'change' ,
85
85
} ,
86
+ inject : {
87
+ configProvider : { default : { } } ,
88
+ } ,
86
89
data ( ) {
87
90
const value = this . value || this . defaultValue
88
91
if ( value && ! interopDefault ( moment ) . isMoment ( value ) ) {
@@ -147,7 +150,7 @@ const TimePicker = {
147
150
</ div >
148
151
) : null
149
152
}
150
- const { prefixCls } = props
153
+ const { prefixCls, getPopupContainer } = props
151
154
let suffixIcon = getComponentFromProp ( this , 'suffixIcon' )
152
155
suffixIcon = Array . isArray ( suffixIcon ) ? suffixIcon [ 0 ] : suffixIcon
153
156
const clockIcon = suffixIcon && (
@@ -178,10 +181,12 @@ const TimePicker = {
178
181
theme = 'filled'
179
182
/>
180
183
)
184
+ const { getPopupContainer : getContextPopupContainer } = this . configProvider
181
185
const timeProps = {
182
186
props : {
183
187
...generateShowHourMinuteSecond ( format ) ,
184
188
...props ,
189
+ getPopupContainer : getPopupContainer || getContextPopupContainer ,
185
190
format,
186
191
value : this . sValue ,
187
192
placeholder : props . placeholder === undefined ? locale . placeholder : props . placeholder ,
Original file line number Diff line number Diff line change @@ -28,6 +28,9 @@ export default {
28
28
prop : 'visible' ,
29
29
event : 'visibleChange' ,
30
30
} ,
31
+ inject : {
32
+ configProvider : { default : { } } ,
33
+ } ,
31
34
data ( ) {
32
35
return {
33
36
sVisible : ! ! this . $props . visible ,
@@ -139,6 +142,7 @@ export default {
139
142
render ( h ) {
140
143
const { $props, $data, $slots, $listeners } = this
141
144
const { prefixCls, openClassName, getPopupContainer } = $props
145
+ const { getPopupContainer : getContextPopupContainer } = this . configProvider
142
146
let children = ( $slots . default || [ ] ) . filter ( c => c . tag || c . text . trim ( ) !== '' )
143
147
children = children . length === 1 ? children [ 0 ] : children
144
148
let sVisible = $data . sVisible
@@ -156,7 +160,7 @@ export default {
156
160
const tooltipProps = {
157
161
props : {
158
162
...$props ,
159
- getTooltipContainer : getPopupContainer ,
163
+ getTooltipContainer : getPopupContainer || getContextPopupContainer ,
160
164
builtinPlacements : this . getPlacements ( ) ,
161
165
visible : sVisible ,
162
166
} ,
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ export default () => ({
14
14
prefixCls : PropTypes . string . def ( 'ant-tooltip' ) ,
15
15
mouseEnterDelay : PropTypes . number . def ( 0.1 ) ,
16
16
mouseLeaveDelay : PropTypes . number . def ( 0.1 ) ,
17
- getTooltipContainer : PropTypes . func ,
18
17
getPopupContainer : PropTypes . func ,
19
18
arrowPointAtCenter : PropTypes . bool . def ( false ) ,
20
19
autoAdjustOverflow : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . object ] ) . def ( true ) ,
You can’t perform that action at this time.
0 commit comments