Skip to content

Commit 1bdffcd

Browse files
committed
fallback to max-width and max-height if necessary
1 parent 2a3dc26 commit 1bdffcd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/plots/plots.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1387,8 +1387,8 @@ plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) {
13871387
// but don't enforce any ratio restrictions
13881388
var computedStyle = isPlotDiv ? window.getComputedStyle(gd) : {};
13891389

1390-
newWidth = parseFloat(computedStyle.width) || fullLayout.width;
1391-
newHeight = parseFloat(computedStyle.height) || fullLayout.height;
1390+
newWidth = parseFloat(computedStyle.width) || parseFloat(computedStyle.maxWidth) || fullLayout.width;
1391+
newHeight = parseFloat(computedStyle.height) || parseFloat(computedStyle.maxHeight) || fullLayout.height;
13921392
}
13931393

13941394
var minWidth = plots.layoutAttributes.width.min,

0 commit comments

Comments
 (0)