Skip to content

Commit cc37da9

Browse files
Put back this.intervalUpdateContent to make the bottom examples in the demo page work again.
1 parent eed3d6d commit cc37da9

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/index.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ class ReactTooltip extends Component {
239239
}
240240
// Get the tooltip content
241241
// calculate in this phrase so that tip width height can be detected
242-
const {multiline} = this.props
242+
const {multiline, getContent} = this.props
243243
const originTooltip = e.currentTarget.getAttribute('data-tip')
244244
const isMultiline = e.currentTarget.getAttribute('data-multiline') || multiline || false
245245

@@ -276,6 +276,19 @@ class ReactTooltip extends Component {
276276
}, () => {
277277
if (scrollHide) this.addScrollListener(e)
278278
this.updateTooltip(e)
279+
280+
if (getContent && Array.isArray(getContent)) {
281+
this.intervalUpdateContent = setInterval(() => {
282+
if (this.mount) {
283+
const {getContent} = this.props
284+
const placeholder = getTipContent(originTooltip, getContent[0](), isMultiline)
285+
const isEmptyTip = this.isEmptyTip(placeholder)
286+
this.setState({
287+
isEmptyTip
288+
})
289+
}
290+
}, getContent[1])
291+
}
279292
})
280293
}
281294

0 commit comments

Comments
 (0)