How to totally disable ARIA

How to totally disable ARIA

WordsmithWordsmith Posts: 22Questions: 0Answers: 0
edited June 2013 in DataTables 1.9
Is there a feature enablement / disablement to turn off ARIA completely in datatables? What would the JS look like? Thanks.

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Currently no there is not. Although you could easily just remove the ARIA code from DataTables.

    Can I ask why you would want to disable it? Have I got something wrong in the implementation?

    Allan
  • WordsmithWordsmith Posts: 22Questions: 0Answers: 0
    edited June 2013
    In trying to find a solution to my post in this previous thread (http://datatables.net/forums/discussion/15784/tablepress-datatables-works-on-everything-but-idevices#Item_16), someone suggested that the iPad may be glitching because of ARIA.

    What lines of code would I have to remove? I don't want to start hacking away at the plugin only to have broken something I'm unaware of.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Ah yes - I'm sorry I've not got a chance to look at that yet. I was hoping to get a chance later today actually - its a darn busy time here :-).

    Anywhere that DataTables uses `setAttribute` and it sets an ARIA attribute, just remove it. What makes you think that is the problem though?

    Allan
  • WordsmithWordsmith Posts: 22Questions: 0Answers: 0
    edited June 2013
    I see a lot of ARIA references with setAttribute, just not sure how to remove it. Take this line for instance:
    [code]o[0][0]==c?(h.setAttribute("aria-sort","asc"==o[0][1]?"ascending":"descending"),h.setAttribute("aria-label",f+("asc"==(l[c].asSorting[o[0][2]+1]?l[c].asSorting[o[0][2]+1]:l[c].asSorting[0])?p.sSortAscending:p.sSortDescending))):h.setAttribute("aria-label",f+("asc"==l[c].asSorting[0]?p.sSortAscending:p.sSortDescending)):h.setAttribute("aria-label",f);a.bSorted=!0;i(a.oInstance).trigger("sort",a);a.oFeatures.bFilter?M(a,a.oPreviousSearch,1):(a.aiDisplay=a.aiDisplayMaster.slice(),a._iDisplayStart=0,[/code]

    Do I remove the entire line or try and dissect the ARIA parts only? Sometimes it's not obvious what needs to be done to get rid of ARIA.

    My reason for thinking ARIA might be the issue is I sought some help on the net and came across davidmeharey.com. He's a coder, like you, works extensively with HTML5 audio, and has knowledge of Apple devices. It was he that gave me the idea that ARIA might be the culprit. I'm just trying to explore any possibility at this point.
  • WordsmithWordsmith Posts: 22Questions: 0Answers: 0
    You know what, I just realized that the js file I have is from a WordPress plugin that uses datatables as a feature. It may not be as easy to get the ARIA out of that file since it looks pretty unformatted. Uggg.
  • WordsmithWordsmith Posts: 22Questions: 0Answers: 0
    Good God I'm botching this up. Is there any way you can give me a "jquery.datatables.min.js" file with ARIA removed? I'm dancing with 2 left feet here...
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    You might be better of not modifying the minified file. I wouldn't even consider it :-)

    I could do the min file, but it would just take away time from trying the audio plug-in test I was hoping to do later on... I'll let you know how I get on with it.

    Allan
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Updated here: http://datatables.net/forums/discussion/15784 . Nothing to do with ARIA :-)
  • jeffwjeffw Posts: 38Questions: 5Answers: 0
    Allan, we would also like to be able to remove ARIA attributes if possible. We have a QA engineer testing with JAWS, and some of the tbody tag attributes are causing some unexpected behavior, specifically: role="alert", aria-live="polite", and aria-relevant="all". They are causing some problems with live region code.

    Would my best bet be to remove setAttribute lines as mentioned above?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Possibly yes. However, if you engineer has any suggestions on how the ARIA attributes used by DataTables could be improved, I would very warmly welcome them so I could integrate them into DataTables core!

    Thanks,
    Allan
  • rink_attendant_6rink_attendant_6 Posts: 16Questions: 4Answers: 1
    aria-live and aria-relevant seem to be correct in accordance with the ARIA specification, but the role is definitely wrong:

    [quote]A message with important, and usually time-sensitive, information. See related alertdialog and status.

    Alerts are used to convey messages to alert the user. In the case of audio warnings this is an accessible alternative for a hearing-impaired user. The alert role goes on the node containing the alert message. Alerts are specialized forms of the status role, which will be processed as an atomic live region.[/quote]

    (Source: http://www.w3.org/TR/wai-aria/roles#alert)

    It is causing JAWS to announce "alert" when going from the search box to the table data.

    A more appropriate role MAY be "grid" on the element, but I'm not sure if this is necessary.
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    What I've done in 1.10 is remove the alert from the table's body and attached it to the table info element based upon the discussion in this thread: http://datatables.net/forums/discussion/13421

    Commit: https://github.com/DataTables/DataTables/commit/74a78b2

    And relevant line:
    https://github.com/DataTables/DataTables/blob/1_10_wip/media/js/jquery.dataTables.js#L2539

    Any additional improvements are very warmly welcomed!

    I didn't use the `grid` role because of the last three words in the ARIA description for the role:

    > A grid is an interactive control which contains cells of tabular data arranged in rows and columns, like a table.

    DataTables is not "like a table" - it is a table! DataTables uses correct semantic markup, so there doesn't seem to me to be any benefit of saying that the table is a table.

    Allan
  • rink_attendant_6rink_attendant_6 Posts: 16Questions: 4Answers: 1
    Awesome, do we have a projected timeline of when 1.10 will be released for production use?
  • allanallan Posts: 63,498Questions: 1Answers: 10,470 Site admin
    Its beta ready now, but I've not had a chance to write the documentation yet. I hope to have that done by the end of this month, start of next and have the beta ready. Full release should be about a month after the beta is out. The pre-beta is in git if you want to give it a whirl!

    Allan
This discussion has been closed.