≡

Is there a bug causing the Select & Buttons plugins to malfunction when BootStrap 5 styling is used?

Is there a bug causing the Select & Buttons plugins to malfunction when BootStrap 5 styling is used?

Tracy LoganTracy Logan Posts: 6Questions: 3Answers: 0
edited November 20 in Select

Links to test cases:
Working example with DataTables 3 styling: https://live.datatables.net/letutise/8/edit?html,js,output
Broken example with BootStrap 5 styling: https://live.datatables.net/letutise/9/edit?html,js,output

Description of problem:
After upgrading from DT 2.3.2 to DT 3.1.5, I've been unable to get the Select plugin interacting properly with the Buttons plugin

Specifically, in a Collection of Buttons that extend selected, those Buttons no longer react to row(s) being selected nor deselected; they start off Enabled, and stay that way

The broken test case linked above does display this problem -- the top-level Buttons that extend selected do work properly, but not the Buttons inside the "Reports" Button that extends collection

However, that broken test case also adds additional issues (the selection bar isn't visible, nor is the on-hover active), so I'm not sure I've properly set up the BS5 test case HTML

I used the Download Builder to create the CDN links for DT3, Buttons 4, Select 4, and BS5 styling, including the base BS5 link -- if anyone can spot what I've done wrong, I'll fix it and see if my issue remains once the others go away

Answers

  • kthorngrenkthorngren Posts: 22,524Questions: 26Answers: 5,173

    Looks like a bug regarding extend: 'selected'. I added this CSS to your test case:

    div.dt-button-collection .dt-button.disabled {
        cursor: default;
        opacity: .4;
        pointer-events: none;
    }
    

    Not sure it is what Allan would use with BS5 but it seems the BS5 style integration is missing the needed CSS when the button is disabled. You can try it as a work around until @allan has a chance to resolve the issue.

    Updated test case:
    https://live.datatables.net/letutise/11/edit

    However, that broken test case also adds additional issues (the selection bar isn't visible, nor is the on-hover active),

    You need to change the default classes applied to the table tag to use BS5 table classes of .table and .table-hover.

    Kevin

  • allanallan Posts: 66,186Questions: 1Answers: 11,040 Site admin

    As is so often the way, I look at something and think "no problem - I'll have that fixed in a moment", and then the wheels come off!

    The disabled class was being applied to the wrong element in the case of the Bootstrap 5 integration. I've corrected that with this commit which will be in the next patch release (I'll aim to do that next week).

    Many thanks for the test cases and input both of you! :)

    Allan

Sign In or Register to comment.