We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3db47c0 commit e3cb3feCopy full SHA for e3cb3fe
inst/www/shared/shiny.js
@@ -34,9 +34,13 @@
34
var x;
35
if (el.currentStyle)
36
x = el.currentStyle[styleProp];
37
- else if (window.getComputedStyle)
38
- x = document.defaultView.getComputedStyle(el, null)
39
- .getPropertyValue(styleProp);
+ else if (window.getComputedStyle) {
+ // On some browsers, getComputedStyle can return null for elements that
+ // aren't visible; don't attempt to retrieve style props in this case.
40
+ var style = document.defaultView.getComputedStyle(el, null);
41
+ if (style)
42
+ x = style.getPropertyValue(styleProp);
43
+ }
44
return x;
45
}
46
0 commit comments