Skip to content

Commit c232eb2

Browse files
committed
Fix SVG issue for older browsers (fixes sampotts#1191)
1 parent fac134d commit c232eb2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/js/controls.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,11 @@ const controls = {
111111
// https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/xlink:href
112112
if ('href' in use) {
113113
use.setAttributeNS('http://www.w3.org/1999/xlink', 'href', path);
114-
} else {
115-
use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
116114
}
117115

116+
// Always set the older attribute even though it's "deprecated" (it'll be around for ages)
117+
use.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
118+
118119
// Add <use> to <svg>
119120
icon.appendChild(use);
120121

0 commit comments

Comments
 (0)