File tree Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Expand file tree Collapse file tree 3 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## 2.23.0
4
+
5
+ - Listen to Stimulus ` disconnect ` event to destroy the chart #1944
6
+
3
7
## 2.18.0
4
8
5
9
- Replace ` chartjs/auto ` import with explicit ` Chart.register() ` call #1263
Original file line number Diff line number Diff line change @@ -36,11 +36,11 @@ class default_1 extends Controller {
36
36
this . dispatchEvent ( 'connect' , { chart : this . chart } ) ;
37
37
}
38
38
disconnect ( ) {
39
+ this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
39
40
if ( this . chart ) {
40
41
this . chart . destroy ( ) ;
41
42
this . chart = null ;
42
43
}
43
- this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
44
44
}
45
45
viewValueChanged ( ) {
46
46
if ( this . chart ) {
Original file line number Diff line number Diff line change @@ -58,12 +58,12 @@ export default class extends Controller {
58
58
}
59
59
60
60
disconnect ( ) {
61
+ this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
62
+
61
63
if ( this . chart ) {
62
64
this . chart . destroy ( ) ;
63
65
this . chart = null ;
64
66
}
65
-
66
- this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
67
67
}
68
68
69
69
/**
You can’t perform that action at this time.
0 commit comments