DataTables / Responsive

Responsive extension for DataTables, providing support for complex tables on all device screen sizes
Other
148 stars 86 forks source link

Fix: Duplicate `click` event with `Select` extension #97

Closed serialine closed 7 years ago

serialine commented 7 years ago

Responsive with Select (event selector: td:first-child), show/hide button click event duplicated each event.

ex) When clicked show/hide button to just show collapsed column, fired select/unselect event too.

var options = {
  select: {
    style: 'multi',
    selector: 'td:first-child'
  }
}

just added e.stopPropagation.

DataTables commented 7 years ago

Have you got a link to a page showing the issue please?

If it is possible to let the event bubble up, I'd like to do so. But if it isn't possible, I'd be fine with this change.

serialine commented 7 years ago

here simple test example https://jsfiddle.net/laires/nuk7wg84/

DataTables commented 7 years ago

Long delay on my reply here - sorry!

I'm inclined to say that this is actually a misconfiguration error. In this sort of case it might be best to have a control column and Select should have an selector that doesn't operate on that column.

I'm not ruling this out entirely - I can see that it could be useful. But if it is possible to keep the click event bubbling, I'd prefer to do so.