Skip to content

Commit 52f4b1b

Browse files
author
Jonas Gossens
committed
🐛 Fix bubble error
1 parent 8885ebb commit 52f4b1b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/react-chayns-bubble/component/Bubble.jsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -55,32 +55,36 @@ export default class Bubble extends PureComponent {
5555
}
5656

5757
componentDidMount() {
58-
if (this.bubbleNode.current) {
58+
if (this.bubbleNode.current && this.bubbleNode.current.classList) {
5959
this.bubbleNode.current.classList.add('cc__bubble--hide');
6060
}
6161
}
6262

6363
show() {
64-
if (!this.bubbleNode.current) {
64+
if (!this.bubbleNode.current || !this.bubbleNode.current.classList) {
6565
return;
6666
}
6767

6868
clearTimeout(this.timeout);
6969
this.bubbleNode.current.classList.remove('cc__bubble--hide');
7070
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+
}
7274
});
7375
}
7476

7577
hide() {
76-
if (!this.bubbleNode.current) {
78+
if (!this.bubbleNode.current || !this.bubbleNode.current.classList) {
7779
return;
7880
}
7981

8082
clearTimeout(this.timeout);
8183
this.bubbleNode.current.classList.remove('cc__bubble--active');
8284
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+
}
8488
}, 500);
8589
}
8690

0 commit comments

Comments
 (0)