]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
fix: Unset _resizeBeforeDraw before _resize() call to avoid possible recursion (...
authorDimitris-Rafail Katsampas <dimitris.katsampas@fuelics.com>
Thu, 8 Aug 2024 18:08:30 +0000 (21:08 +0300)
committerGitHub <noreply@github.com>
Thu, 8 Aug 2024 18:08:30 +0000 (20:08 +0200)
* fix: Unset _resizeBeforeDraw before _resize to avoid possible recursion

* chore: Comment update

* chore: Reverted dependency change in package json

src/core/core.controller.js

index 3c643e8ba3f94d2f83892239d70ff5e3f2ec13ba..47b238da8aa2ec5753e8dfd56c578ec6d17c7c1c 100644 (file)
@@ -717,8 +717,9 @@ class Chart {
     let i;
     if (this._resizeBeforeDraw) {
       const {width, height} = this._resizeBeforeDraw;
-      this._resize(width, height);
+      // Unset pending resize request now to avoid possible recursion within _resize
       this._resizeBeforeDraw = null;
+      this._resize(width, height);
     }
     this.clear();