Skip to content

Commit 8748342

Browse files
Add aria label
1 parent ebb7b12 commit 8748342

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/components/modebar/modebar.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,16 @@ proto.createButton = function(config) {
150150
button.setAttribute('tabindex', '0');
151151
button.setAttribute('rel', 'tooltip');
152152
button.className = 'modebar-btn';
153-
153+
154154
var title = config.title;
155155
if(title === undefined) title = config.name;
156156
// for localization: allow title to be a callable that takes gd as arg
157157
else if(typeof title === 'function') title = title(this.graphInfo);
158158

159-
if(title || title === 0) button.setAttribute('data-title', title);
159+
if(title || title === 0) {
160+
button.setAttribute('data-title', title)
161+
button.setAttribute("aria-label", title)
162+
};
160163

161164
if(config.attr !== undefined) button.setAttribute('data-attr', config.attr);
162165

0 commit comments

Comments
 (0)