Skip to content

Commit

Permalink
Set role='presentation' instead of 'img' on the icons
Browse files Browse the repository at this point in the history
  • Loading branch information
mar10 committed May 5, 2017
1 parent b53eaee commit 3ab1a4c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
7 changes: 0 additions & 7 deletions src/jquery.fancytree.ariagrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@
- Don't put role="button" on expanders if they are not visible (leaf nodes)
- For role="img" on folders:
- Are they important to understanding the line? I'm not sure they are given that
we can use aria-expanded to say whether something is a folder.
Therefore I suggest to put role="presentation" instead
- If it is really is important for understanding the line, add an aria-label
to it so the screen reader knows what the img means
- enable treeOpts.aria by default
=> requires some benchmarks, confirm it does not affect performance too much
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.fancytree.js
Original file line number Diff line number Diff line change
Expand Up @@ -3583,7 +3583,7 @@ $.extend(Fancytree.prototype,
// }
// }
if( icon !== false ) {
role = aria ? " role='img'" : "";
role = aria ? " role='presentation'" : "";
if ( typeof icon === "string" ) {
if( TEST_IMG.test(icon) ) {
// node.icon is an image url. Prepend imagePath
Expand Down

0 comments on commit 3ab1a4c

Please sign in to comment.