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) {
345345 } ;
346346
347347 // 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 ) ) {
352353 // Align the text at the left
353354 attrs [ 'text-anchor' ] = 'start' ;
354355 attrs . x = 5 ;
You can’t perform that action at this time.
0 commit comments