Why Role=”alert” on tbody? (NVDA cannot read content of the table)

Why Role=”alert” on tbody? (NVDA cannot read content of the table)

JuanMirandaJuanMiranda Posts: 3Questions: 1Answers: 0

The assistive technology is not reading the content of the table (only the headers), I found out it was caused by the property Role=”alert” on the tbody element. If I remove it everything returns to normal.
Why could I have this Role=”alert” on the tbody? Even if I set the role to something else (like “grid”) it is replaced with alert when the datatable is created

Something related to this was asked before but the discussion was closed with no answer.

Answers

  • allanallan Posts: 61,787Questions: 1Answers: 10,115 Site admin

    Can you link to a page showing the issue please? This example doesn't have a role on the tbody at all. The role that is used is grid on the table element.

    Allan

  • JuanMirandaJuanMiranda Posts: 3Questions: 1Answers: 0

    Hello Allan thank you so much for your response, I tried on that example and on many others on this site, they work fine with nvda because when they render they don’t have role=”alert” on the tbody, if I go to the tbody of any of your examples and manually set the role=”alert” in the debugger then I can reproduce the issue on your site.
    The site I am working on is private so I can’t show you directly but I will get you a sample where the issue can be reproduced.
    I am testing this in Chrome 56.0 by the way

  • allanallan Posts: 61,787Questions: 1Answers: 10,115 Site admin

    What version of DataTables are you using? The current release, 1.10.13 which is used in the examples does not add the alert role, as you can see in the examples.

    Allan

  • JuanMirandaJuanMiranda Posts: 3Questions: 1Answers: 0

    Here it can be reproduce https://jsfiddle.net/Herudur/jrbyanph/1/ (the role for the tbody is set in the html)
    I am using version 1.9, unfortunately because of the project policies we are not able to upgrade.
    Would it be a way to configure this value in the current version?
    The only alternative I see by now is to change the role in the JS after the initialization of the DataTable

  • allanallan Posts: 61,787Questions: 1Answers: 10,115 Site admin

    I am using version 1.9

    Right - that's the problem. DataTables 1.9 is no longer supported and 1.10 has a lot of fixes, improvements and new features over 1.9.

    If you can't upgrade, you'd need to modify the 1.9 source that you are using. A search for alert in the code should show you where it is being set and you can remove that.

    Allan

This discussion has been closed.