Skip to content

Commit 1beda28

Browse files
committed
previousPromises may *not* return a promise itself - use syncOrAsync
1 parent 35d0699 commit 1beda28

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/plots/cartesian/dragbox.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,13 @@ module.exports = function dragBox(gd, plotinfo, x, y, w, h, ns, ew) {
657657
// be repositioning the data in the relayout. But DON'T call
658658
// ticksAndAnnotations again - it's unnecessary and would overwrite `updates`
659659
updateSubplots([0, 0, pw, ph]);
660-
Plots.previousPromises(gd).then(function() { Plotly.relayout(gd, updates); });
660+
661+
// since we may have been redrawing some things during the drag, we may have
662+
// accumulated MathJax promises - wait for them before we relayout.
663+
Lib.syncOrAsync([
664+
Plots.previousPromises,
665+
function() { Plotly.relayout(gd, updates); }
666+
], gd);
661667
}
662668

663669
// updateSubplots - find all plot viewboxes that should be

0 commit comments

Comments
 (0)