Skip to content

Commit c8cdf89

Browse files
author
Stefan Hayden
committed
update position durring this.intervalUpdateContent of tooltip will not be in correct place.
1 parent 0b15b46 commit c8cdf89

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

example/src/index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const Test = React.createClass({
231231
<div className="side">
232232
<a data-for='overTime' data-tip>=( •̀д•́)</a>
233233
<ReactTooltip id='overTime'
234-
getContent={[() => {return new Date().toISOString()}, 1000]}/>
234+
getContent={[() => {return 'Random length content'.slice(0, Math.floor(Math.random() * 21) + 1)}, 1000]}/>
235235
</div>
236236
</div>
237237
<br />
@@ -241,8 +241,10 @@ const Test = React.createClass({
241241
"<ReactTooltip id='getContent' getContent={() => Math.floor(Math.random() * 100)} />"}</p>
242242
</div>
243243
<div>
244-
<p>{"<a data-for='overTime' data-tip>=( •̀д•́)</a>\n" +
245-
"<ReactTooltip id='overTime' getContent={[() => {return new Date().toISOString()}, 1000]}/>"}</p>
244+
<p>{"<a data-for='overTime' data-tip>=( •̀д•́)</a>\naaaa" +
245+
"<ReactTooltip id='overTime' getContent={[() => {\n" +
246+
" return 'Random length content'.slice(0, Math.floor(Math.random() * 21) + 1)\n" +
247+
"}, 1000]}/>"}</p>
246248
</div>
247249
</pre>
248250
</div>

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ class ReactTooltip extends Component {
301301
placeholder,
302302
isEmptyTip
303303
})
304+
this.updatePosition()
304305
}
305306
}, getContent[1])
306307
}

0 commit comments

Comments
 (0)