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 11# CHANGELOG
22
3+ ## 2.23.0
4+
5+ - Listen to Stimulus ` disconnect ` event to destroy the chart #1944
6+
37## 2.18.0
48
59- 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 {
3636 this . dispatchEvent ( 'connect' , { chart : this . chart } ) ;
3737 }
3838 disconnect ( ) {
39+ this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
3940 if ( this . chart ) {
4041 this . chart . destroy ( ) ;
4142 this . chart = null ;
4243 }
43- this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
4444 }
4545 viewValueChanged ( ) {
4646 if ( this . chart ) {
Original file line number Diff line number Diff line change @@ -58,12 +58,12 @@ export default class extends Controller {
5858 }
5959
6060 disconnect ( ) {
61+ this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
62+
6163 if ( this . chart ) {
6264 this . chart . destroy ( ) ;
6365 this . chart = null ;
6466 }
65-
66- this . dispatchEvent ( 'disconnect' , { chart : this . chart } ) ;
6767 }
6868
6969 /**
You can’t perform that action at this time.
0 commit comments