File tree 1 file changed +9
-5
lines changed
src/react-chayns-bubble/component
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -55,32 +55,36 @@ export default class Bubble extends PureComponent {
55
55
}
56
56
57
57
componentDidMount ( ) {
58
- if ( this . bubbleNode . current ) {
58
+ if ( this . bubbleNode . current && this . bubbleNode . current . classList ) {
59
59
this . bubbleNode . current . classList . add ( 'cc__bubble--hide' ) ;
60
60
}
61
61
}
62
62
63
63
show ( ) {
64
- if ( ! this . bubbleNode . current ) {
64
+ if ( ! this . bubbleNode . current || ! this . bubbleNode . current . classList ) {
65
65
return ;
66
66
}
67
67
68
68
clearTimeout ( this . timeout ) ;
69
69
this . bubbleNode . current . classList . remove ( 'cc__bubble--hide' ) ;
70
70
this . timeout = setTimeout ( ( ) => {
71
- this . bubbleNode . current . classList . add ( 'cc__bubble--active' ) ;
71
+ if ( this . bubbleNode . current && this . bubbleNode . current . classList ) {
72
+ this . bubbleNode . current . classList . add ( 'cc__bubble--active' ) ;
73
+ }
72
74
} ) ;
73
75
}
74
76
75
77
hide ( ) {
76
- if ( ! this . bubbleNode . current ) {
78
+ if ( ! this . bubbleNode . current || ! this . bubbleNode . current . classList ) {
77
79
return ;
78
80
}
79
81
80
82
clearTimeout ( this . timeout ) ;
81
83
this . bubbleNode . current . classList . remove ( 'cc__bubble--active' ) ;
82
84
this . timeout = setTimeout ( ( ) => {
83
- this . bubbleNode . current . classList . add ( 'cc__bubble--hide' ) ;
85
+ if ( this . bubbleNode . current && this . bubbleNode . current . classList ) {
86
+ this . bubbleNode . current . classList . add ( 'cc__bubble--hide' ) ;
87
+ }
84
88
} , 500 ) ;
85
89
}
86
90
You can’t perform that action at this time.
0 commit comments