From: Karan Bhatia Date: Fri, 23 Jun 2017 22:14:16 +0000 (-0700) Subject: Add aria-hidden=true attribute to hidden iframe for resizing (#4400) X-Git-Tag: v2.7.0~1^2~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2a7df85180acb0df72dd5ed3afd976b2d4b2398b;p=thirdparty%2FChart.js.git Add aria-hidden=true attribute to hidden iframe for resizing (#4400) Add aria-hidden=true attribute to hidden iframe for resizing. This prevents screen readers in ItemMode from navigating to the hidden iframe. --- diff --git a/src/platforms/platform.dom.js b/src/platforms/platform.dom.js index 524bc346e..d498bc854 100644 --- a/src/platforms/platform.dom.js +++ b/src/platforms/platform.dom.js @@ -130,6 +130,10 @@ module.exports = function(Chart) { // https://github.com/chartjs/Chart.js/issues/3090 iframe.tabIndex = -1; + // Prevent iframe from gaining focus on ItemMode keyboard navigation + // Accessibility bug fix + iframe.setAttribute('aria-hidden', 'true'); + // If the iframe is re-attached to the DOM, the resize listener is removed because the // content is reloaded, so make sure to install the handler after the iframe is loaded. // https://github.com/chartjs/Chart.js/issues/3521