]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Add aria-hidden=true attribute to hidden iframe for resizing (#4400)
authorKaran Bhatia <kabhati@microsoft.com>
Fri, 23 Jun 2017 22:14:16 +0000 (15:14 -0700)
committerEvert Timberg <evert.timberg+github@gmail.com>
Fri, 23 Jun 2017 22:14:16 +0000 (18:14 -0400)
Add aria-hidden=true attribute to hidden iframe for resizing. This prevents screen readers in ItemMode from navigating to the hidden iframe.

src/platforms/platform.dom.js

index 524bc346e37048df4ef47e56bd477c70c9ed8a1d..d498bc854b58cb670b6c9d97a5dd6480e50c0295 100644 (file)
@@ -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