Skip to content

Commit

Permalink
fix: coerce resize duration when callback specified instead of duration
Browse files Browse the repository at this point in the history
  • Loading branch information
techfg committed Dec 22, 2024
1 parent 1336046 commit 534a9ed
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@

// allow omitting duration
callback = callback || duration;
duration = u.isNumeric(duration) ? duration : 0;

function sizeCanvas(canvas, w, h) {
if (m.hasCanvas()) {
Expand Down Expand Up @@ -195,7 +196,7 @@
/*
When autoresize is enabled, we obtain the width of the wrapper element and resize to that, however when we're hidden because of
one of our ancenstors, jQuery width function returns 0. Ideally, we could use ResizeObserver/MutationObserver to detect
when we hide/show and resize on that event instead of resizing while we are not visible but until official support of older
when we hide/show and resize on that event instead of resizing while we are not visible but until official support of older
browsers is dropped, we need to go this route.
*/
me.resize(
Expand Down

0 comments on commit 534a9ed

Please sign in to comment.