Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit ada5850

Browse files
devversionThomasBurleson
authored andcommitted
fix(icon): disable e11 focus for SVG icons
Currently IE11 always sets the SVG icons focusable. This can be reproduced by tabbing through the `Getting Started` section of the docs. There will be always two tab-steps when iterating through the icon button in IE11. Fixes #7250 Closes #7321
1 parent 557eea8 commit ada5850

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/components/icon/icon.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@ describe('mdIcon service', function() {
473473
'height': '100%',
474474
'width' : '100%',
475475
'preserveAspectRatio': 'xMidYMid meet',
476-
'viewBox' : svg.getAttribute('viewBox') || '0 0 24 24'
476+
'viewBox' : svg.getAttribute('viewBox') || '0 0 24 24',
477+
'focusable': false
477478
}, function(val, attr) {
478479
svg.setAttribute(attr, val);
479480
}, this);

src/components/icon/js/iconService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,8 @@
523523
'height': '100%',
524524
'width' : '100%',
525525
'preserveAspectRatio': 'xMidYMid meet',
526-
'viewBox' : this.element.getAttribute('viewBox') || ('0 0 ' + viewBoxSize + ' ' + viewBoxSize)
526+
'viewBox' : this.element.getAttribute('viewBox') || ('0 0 ' + viewBoxSize + ' ' + viewBoxSize),
527+
'focusable': false // Disable IE11s default behavior to make SVGs focusable
527528
}, function(val, attr) {
528529
this.element.setAttribute(attr, val);
529530
}, this);

0 commit comments

Comments
 (0)