Skip to content

Commit f3d22ce

Browse files
committed
Properly retain original opacity of 0 (0 is falsy in JavaScript), closes #1406
1 parent e266a3c commit f3d22ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

inst/htmlwidgets/plotly.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ function TraceManager(graphDiv, highlight) {
522522
// avoid doing this over and over
523523
this.origOpacity = [];
524524
for (var i = 0; i < this.origData.length; i++) {
525-
this.origOpacity[i] = this.origData[i].opacity || 1;
525+
this.origOpacity[i] = this.origData[i].opacity === 0 ? 0 : (this.origData[i].opacity || 1);
526526
}
527527

528528
// key: group name, value: null or array of keys representing the

0 commit comments

Comments
 (0)