File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " react-tooltip" ,
3- "version" : " 0.6.0 " ,
3+ "version" : " 0.6.1 " ,
44 "description" : " react tooltip component" ,
55 "main" : " dist/react-tooltip.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ export default class ReactTooltip extends Component {
2626 constructor ( props ) {
2727 super ( props )
2828 this . _bind ( 'showTooltip' , 'updateTooltip' , 'hideTooltip' )
29+ this . mount = true
2930 this . state = {
3031 show : false ,
3132 multilineCount : 0 ,
@@ -51,16 +52,21 @@ export default class ReactTooltip extends Component {
5152 *
5253 **/
5354 globalHide ( ) {
54- this . hideTooltip ( )
55+ if ( this . mount ) {
56+ this . hideTooltip ( )
57+ }
5558 }
5659
5760 globalRebuild ( ) {
58- this . unbindListener ( )
59- this . bindListener ( )
61+ if ( this . mount ) {
62+ this . unbindListener ( )
63+ this . bindListener ( )
64+ }
6065 }
6166
6267 componentWillUnmount ( ) {
6368 this . unbindListener ( )
69+ this . mount = false
6470 let tag = document . querySelector ( 'style[id="react-tooltip"]' )
6571 document . getElementsByTagName ( 'head' ) [ 0 ] . removeChild ( tag )
6672 window . removeEventListener ( '__react_tooltip_hide_event' , this . globalHide )
You can’t perform that action at this time.
0 commit comments