Skip to content

Commit

Permalink
Merge pull request #310 from stefanhayden/update-position-with-content
Browse files Browse the repository at this point in the history
Update position with content
  • Loading branch information
aronhelser authored May 1, 2018
2 parents b633151 + c8cdf89 commit 3b48785
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions example/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ class Test extends React.Component {
<div className="side">
<a data-for='overTime' data-tip>=( •̀д•́)</a>
<ReactTooltip id='overTime'
getContent={[() => {return new Date().toISOString()}, 1000]}/>
getContent={[() => {return 'Random length content'.slice(0, Math.floor(Math.random() * 21) + 1)}, 1000]}/>
</div>
</div>
<br />
Expand All @@ -241,8 +241,10 @@ class Test extends React.Component {
"<ReactTooltip id='getContent' getContent={() => Math.floor(Math.random() * 100)} />"}</p>
</div>
<div>
<p>{"<a data-for='overTime' data-tip>=( •̀д•́)</a>\n" +
"<ReactTooltip id='overTime' getContent={[() => {return new Date().toISOString()}, 1000]}/>"}</p>
<p>{"<a data-for='overTime' data-tip>=( •̀д•́)</a>\naaaa" +
"<ReactTooltip id='overTime' getContent={[() => {\n" +
" return 'Random length content'.slice(0, Math.floor(Math.random() * 21) + 1)\n" +
"}, 1000]}/>"}</p>
</div>
</pre>
</div>
Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ class ReactTooltip extends React.Component {
this.setState({
isEmptyTip
})
this.updatePosition()
}
}, getContent[1])
}
Expand Down

0 comments on commit 3b48785

Please sign in to comment.