Skip to content

Commit c80eb3a

Browse files
committed
Bump 0.3.1
1 parent d37767e commit c80eb3a

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

lib/tooltip.js

+16-2
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,24 @@ var Tooltip = function (_Component) {
8484
var place = nextProps.place;
8585

8686
if (el && (this.props.el != el || this.props.place !== place)) {
87-
var offset = (0, _utils.placement)(place, this.refs.tooltip, el);
88-
this.setState(offset);
87+
this.updatePosition(nextProps);
8988
}
9089
}
90+
}, {
91+
key: 'componentDidUpdate',
92+
value: function componentDidUpdate(prevProps) {
93+
var content = prevProps.content;
94+
95+
if (this.props.content !== content) {
96+
this.updatePosition(this.props);
97+
}
98+
}
99+
}, {
100+
key: 'updatePosition',
101+
value: function updatePosition(props) {
102+
var offset = (0, _utils.placement)(props.place, this.refs.tooltip, props.el);
103+
this.setState(offset);
104+
}
91105
}, {
92106
key: 'render',
93107
value: function render() {

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "redux-tooltip",
3-
"version": "0.3.0",
3+
"version": "0.3.1",
44
"description": "A tooltip React component for Redux",
55
"main": "./lib/index.js",
66
"repository": {

0 commit comments

Comments
 (0)