Basic Column Visibility - Clicking slide of colvis button has unexpected result

Basic Column Visibility - Clicking slide of colvis button has unexpected result

colbrothcolbroth Posts: 3Questions: 3Answers: 0

Problem:
If you happen to slide the mouse while clicking a column visibility button, the button will highlight in blue and will not enable the visibility of the column.

Reproduce:
1. Open Basic Column Visibility example at https://datatables.net/extensions/buttons/examples/column_visibility/simple.html
2. Hide the column "Name"
3. Click on Column Visibility button
4. Click on "Name" while dragging mouse
5. Notice the Name is highlighted in blue and the "Name" column was not made visible.
6. Expected the Name column to become visible. Another click (without drag) will make Name visible. This was just notice when testing the column visibility feature and happened to drag mouse a bit.

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599
    edited February 2018

    Hi colbroth,

    Yep, it looks like it's just doing a selection highlight of the button when the drag takes it out of the button area. I'm not certain that's a bug though - since a button should be clicked, not dragged. One for @allan methinks.

    Cheers,

    Colin

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Notice the Name is highlighted in blue and the "Name" column was not made visible.

    This means it has focus. Press "tab" and the keyboard focus will move to the next button (although the CSS styling for that is a little poor with the activated buttons).

    If you release the mouse button outside of the button, then the "click" action doesn't complete inside the button, and therefore it should not be activated.

    Allan

This discussion has been closed.