Skip to content

Commit

Permalink
fix: Unset _resizeBeforeDraw before _resize() call to avoid possible …
Browse files Browse the repository at this point in the history
…recursion (#11851)

* fix: Unset _resizeBeforeDraw before _resize to avoid possible recursion

* chore: Comment update

* chore: Reverted dependency change in package json
  • Loading branch information
CatchABus authored Aug 8, 2024
1 parent 147ee59 commit f3f84fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/core.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit f3f84fd

Please sign in to comment.