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

p-tree renders invalid html for accessibility #7550

Closed
Trakhan opened this issue Apr 15, 2019 · 0 comments
Closed

p-tree renders invalid html for accessibility #7550

Trakhan opened this issue Apr 15, 2019 · 0 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@Trakhan
Copy link

Trakhan commented Apr 15, 2019

I'm submitting a ... (check one with "x")

[x] bug report => Search github for a similar issue or PR before submitting
[ ] feature request => Please check if request is not on the roadmap already https://github.com/primefaces/primeng/wiki/Roadmap
[ ] support request => Please do not submit support request here, instead see http://forum.primefaces.org/viewforum.php?f=35

Plunkr Case (Bug Reports)
No necessary.

Current behavior

Role of containing 'ul' element in tree DOM is overriden to role="tree" leaving child 'li' elements without parent with correct role.

<p-tree>
<div class="ui-tree ui-widget ui-widget-content ui-corner-all">
<ul class="ui-tree-container" role="tree">
<p-treenode>
<li class="ui-treenode ui-treenode-leaf" >
<div class="ui-treenode-content" role="treeitem" tabindex="0" draggable="false" aria-posinset="1" aria-selected="false">
<span class="ui-tree-toggler pi pi-fw ui-unselectable-text pi-caret-right"></span>
<span class="ui-treenode-label ui-corner-all" >
<span>Backup</span>
</span>
</div>
</li>
</p-treenode>
</ul>
</div>
</p-tree>

Found out with Axe chrome plugin (accessibility testing tool): https://www.deque.com/axe/

Expected behavior

Role of child elements should be probably overriden too. Simple solution could be moving role="treeitem" from div.ui-treenode-content to it's parent li element.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Correct HTML accessibility tree;

Please tell us about your environment:

  • Angular version: 7.2.6
  • PrimeNG version: 7.0.5
  • Browser: [all]
  • Language: [all]
@cagataycivici cagataycivici self-assigned this Apr 17, 2019
@cagataycivici cagataycivici added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Apr 17, 2019
@cagataycivici cagataycivici added this to the 7.1.1 milestone Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants