Column with sorting disabled generates an invalid aria-controls value of "undefined"

Column with sorting disabled generates an invalid aria-controls value of "undefined"

GarthMartinGarthMartin Posts: 4Questions: 2Answers: 0

Our WCAG tester identified an issue with a table that has had sorting disabled via columnDefs, where the aria-controls value is "undefined" instead of the table name.

My columnDefs parameter is :
"columnDefs" : [{ "targets" : [7], "orderable": false }]

which generates this as the HTML:

<button type="button" aria-controls="undefined" title="Actions: activate for ascending sort">Actions<span class="sorting-cnt"><span class="sorting-icons" aria-hidden="true"></span></span></button>

I tried adding a ariaTitle as well but it does not do anything differently.

Any way to get around this issue?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 62,088Questions: 1Answers: 10,180 Site admin
    Answer ✓

    I'm not actually certain where that HTML is coming from. We don't put a button into the table header for sorting.

    I've tried to recreate the issue in this example but it appears to be operating as expected (no aria-controls on the ordering disable table header cell).

    Could you update my test case, or link to another which shows the issue please?

    Thanks,
    Allan

  • GarthMartinGarthMartin Posts: 4Questions: 2Answers: 0

    Ok thanks Allan...I think the issue is elsewhere.

Sign In or Register to comment.