Skip to content

Commit a729acc

Browse files
authored
Merge pull request #1691 from HenryKeen/fix-ie11-image-promise
Move the promise resolution to address IE11 bug
2 parents e58dcb0 + 310f762 commit a729acc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/images/draw.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,15 @@ module.exports = function draw(gd) {
9999
var dataURL = canvas.toDataURL('image/png');
100100

101101
thisImage.attr('xlink:href', dataURL);
102+
103+
// resolve promise in onload handler instead of on 'load' to support IE11
104+
// see https://github.com/plotly/plotly.js/issues/1685
105+
// for more details
106+
resolve();
102107
};
103108

104109

105110
thisImage.on('error', errorHandler);
106-
thisImage.on('load', resolve);
107111

108112
img.src = d.source;
109113

0 commit comments

Comments
 (0)