BUG: Multiple Issues w/ Select Extension

BUG: Multiple Issues w/ Select Extension

SickPuPSickPuP Posts: 13Questions: 6Answers: 0

Link to test case: https://jsfiddle.net/ddelella/k21ospv0/1/
Debugger code (debug.datatables.net): None
Error messages shown: None
Description of problem:

jquery version: 3.7.1
bootstrap version: 3.4.1
datatables.net version: 2.0.7
select extension version: 2.0.1

ISSUE #1: Even though orderable is set to false for the checkbox column, since no default ordering was given for the table it still shows the sort arrow in the column header. As soon as another column is sorted, the arrow disappears and the column is truly not orderable.
EXPECTED BEHAVIOR: The table should default to the first column index and not the one defined for the checkbox if orderable is false.

ISSUE #2: When selecting the row for the first time there is an offset box that appears when the checkbox is in focus.
FIX: I have corrected this using the following styling:

input[type=checkbox].dt-select-checkbox:focus {
    outline: unset;
    outline-offset: unset;
}

ISSUE #3: When I select a row for the first time, everything works as expected. Clicking the row again does not unselect because I set toggleable to false. However, if I click directly on the checkbox in the selected row, it unchecks the checkbox but leaves the row selected. The :after pseudo class appears to be getting removed even though the row is still selected.
EXPECTED BEHAVIOR: The checkbox stay checked even if clicked. The checkbox should be a visual element and not an actionable one.

Answers

  • allanallan Posts: 63,643Questions: 1Answers: 10,492 Site admin

    Hi,

    Thanks for the details!

    1) This is actually expected behaviour and it is because the default ordering for the table is [ 0, 'asc' ] - therefore the first column in the table will be ordered upon (as the columns.orderable documentation notes, that effects the user's ability to click to sort a column, but not the API. So the order parameter is applied. Add order: [ 1, 'asc' ] and that will "fix" it.

    2) Gah - that ugly Chrome outline is horrible. It doesn't happen in Firefox, but rather than disabling the outline completely (which is bad for accessibility) I'll look at removing it on a click action.

    3) Thank you - fix committed and it will be in the nightly build soon, and the next release.

    Regards,
    Allan

Sign In or Register to comment.