Skip to content

Commit

Permalink
Merge pull request #56 from jasongaare/bug/measurement-layout-loop
Browse files Browse the repository at this point in the history
prevent update geometry getting called in a loop on some devices
  • Loading branch information
jasongaare authored Oct 10, 2019
2 parents 2c5e3f9 + 68def60 commit 9944994
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-walkthrough-tooltip",
"version": "1.1.2",
"version": "1.1.3",
"description": "An inline wrapper for calling out React Native components via tooltip",
"main": "src/tooltip.js",
"scripts": {
Expand Down
8 changes: 3 additions & 5 deletions src/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,6 @@ class Tooltip extends Component {
this.setState({ contentSize }, () => {
this._updateGeometry();
});

if (React.Children.count(this.props.children) === 0) {
this.doChildlessPlacement();
}
};

onChildMeasurementComplete = (rect) => {
Expand All @@ -237,7 +233,9 @@ class Tooltip extends Component {
},
() => {
this.isMeasuringChild = false;
this._updateGeometry();
if (this.state.contentSize.width) {
this._updateGeometry();
}
}
);
};
Expand Down

0 comments on commit 9944994

Please sign in to comment.