Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Accessibility - Add unique titles to frames #4534

Closed
frankspin89 opened this issue Jul 20, 2017 · 3 comments
Closed

[FEATURE] Accessibility - Add unique titles to frames #4534

frankspin89 opened this issue Jul 20, 2017 · 3 comments
Milestone

Comments

@frankspin89
Copy link

Expected Behavior

Frames must have unique title attribute
https://dequeuniversity.com/rules/axe/1.1/frame-title

Current Behavior

<iframe class="chartjs-hidden-iframe" tabindex="-1" style="display: block; overflow: hidden; border: 0px; margin: 0px; top: 0px; left: 0px; bottom: 0px; right: 0px; height: 100%; width: 100%; position: absolute; pointer-events: none; z-index: -1;">

Possible Solution

<iframe title="Unique title goes here" class="chartjs-hidden-iframe" tabindex="-1" style="display: block; overflow: hidden; border: 0px; margin: 0px; top: 0px; left: 0px; bottom: 0px; right: 0px; height: 100%; width: 100%; position: absolute; pointer-events: none; z-index: -1;">
@devjeetr
Copy link

I'm new to contributing to this project but I've been looking at this issue and I was thinking we could use the uid of each chart to create this unique title. One way to do this would be to modify createResizer() to accept chart id as the second argument. So we would have to change this:

    function createResizer(handler) {
	    var iframe = document.createElement('iframe');
            iframe.className = 'chartjs-hidden-iframe';

to something like:

    function createResizer(handler, chartId) {
	    var iframe = document.createElement('iframe');
	    iframe.title = 'Resizer Frame for Chart ' + chartId;
	    iframe.className = 'chartjs-hidden-iframe';

Also, inside addResizeListener, we would have to change the call to createResizer:

function addResizeListener(node, listener, chart){
   // ....
   stub.resizer = createResizer(notify, chart.id);

Any thoughts? I'm very new to this project so forgive me if I'm missing something major in here.

@simonbrunel
Copy link
Member

@devjeetr I don't think the resizer should be bound to the chart id since it will soon be possible to share the same resizer between multiple charts. Instead, I would keep it simple and set a generic (and short) title (e.g. title="chartjs-iframe"). Anyway, this iframe is going to be replaced by divs hopefully soon.

@simonbrunel
Copy link
Member

@frankspin89 @devjeetr starting #4596, we don't use IFRAME anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants