Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update position with content #310

Merged
merged 1 commit into from
May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ const Test = React.createClass({
<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 @@ const Test = React.createClass({
"<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 @@ -301,6 +301,7 @@ class ReactTooltip extends Component {
placeholder,
isEmptyTip
})
this.updatePosition()
}
}, getContent[1])
}
Expand Down