Skip to content

Commit 49e6fe5

Browse files
committed
Fix wrapping issue with legend in Chrome
1 parent 3058519 commit 49e6fe5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

inst/htmlwidgets/leaflet.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ methods.addLegend = function (options) {
18481848
labels.push(options.na_label);
18491849
}
18501850
for (var i = 0; i < colors.length; i++) {
1851-
legendHTML += "<i style=\"background:" + colors[i] + ";opacity:" + options.opacity + "\"></i> " + labels[i] + "<br/>";
1851+
legendHTML += "<i style=\"background:" + colors[i] + ";opacity:" + options.opacity + "\"></i> " + labels[i] + "<br clear='both'/>";
18521852
}
18531853
div.innerHTML = legendHTML;
18541854
}

javascript/src/methods.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,7 @@ methods.addLegend = function(options) {
783783
}
784784
for (let i = 0; i < colors.length; i++) {
785785
legendHTML += "<i style=\"background:" + colors[i] + ";opacity:" +
786-
options.opacity + "\"></i> " + labels[i] + "<br/>";
786+
options.opacity + "\"></i> " + labels[i] + "<br clear='both'/>";
787787
}
788788
div.innerHTML = legendHTML;
789789
}

0 commit comments

Comments
 (0)