File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -345,10 +345,11 @@ plots.addLinks = function(gd) {
345
345
} ;
346
346
347
347
// If text's width is bigger than the layout
348
- // IE doesn't like getComputedTextLength if an element
349
- // isn't visible, which it (sometimes?) isn't
350
- // apparently offsetParent is null for invisibles.
351
- if ( text && text . getComputedTextLength ( ) >= ( fullLayout . width - 20 ) ) {
348
+ // Check that text is a child node or document.body
349
+ // because otherwise IE/Edge might throw an exception
350
+ // when calling getComputedTextLength().
351
+ // Apparently offsetParent is null for invisibles.
352
+ if ( document . body . contains ( text ) && text . getComputedTextLength ( ) >= ( fullLayout . width - 20 ) ) {
352
353
// Align the text at the left
353
354
attrs [ 'text-anchor' ] = 'start' ;
354
355
attrs . x = 5 ;
You can’t perform that action at this time.
0 commit comments