Skip to content

Commit bab862f

Browse files
committed
Also add check to src
1 parent 96690c0 commit bab862f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Chartjs/assets/src/controller.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ export default class extends Controller {
2727
private chart: Chart | null = null;
2828

2929
connect() {
30+
if(Chart.getChart(this.element)) {
31+
// Chart is already connected
32+
return;
33+
}
34+
3035
if (!isChartInitialized) {
3136
isChartInitialized = true;
3237
this.dispatchEvent('init', {

0 commit comments

Comments
 (0)