Skip to content
This repository has been archived by the owner on May 7, 2019. It is now read-only.

getBoundingClientRect #224

Merged
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
7 changes: 6 additions & 1 deletion src/TextOverflowWrapper/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class TextOverflowWrapper extends Component {

componentDidMount() {
//Set time out to ensure calculation happens after render
setTimeout(() => {
this.timerId = setTimeout(() => {
let input = this.overflowTooltipRef;
if (typeof input !== "undefined" && input.current.getBoundingClientRect()) {
let inputRect = input.current.getBoundingClientRect();
Expand All @@ -33,6 +33,11 @@ class TextOverflowWrapper extends Component {
}
}, 500);
}

componentWillUnmount() {
clearTimeout(this.timerId);
}

render() {
const {props, state} = this;
return (
Expand Down