From f3f84fd624e9e7e750c15db0508b573bd09e8563 Mon Sep 17 00:00:00 2001 From: Dimitris-Rafail Katsampas Date: Thu, 8 Aug 2024 21:08:30 +0300 Subject: [PATCH] fix: Unset _resizeBeforeDraw before _resize() call to avoid possible recursion (#11851) * fix: Unset _resizeBeforeDraw before _resize to avoid possible recursion * chore: Comment update * chore: Reverted dependency change in package json --- src/core/core.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/core.controller.js b/src/core/core.controller.js index 3c643e8ba3f..47b238da8aa 100644 --- a/src/core/core.controller.js +++ b/src/core/core.controller.js @@ -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();