tristen / tablesort

:arrow_up_down: A small tablesorter in plain JavaScript
https://tristen.ca/tablesort/demo/
MIT License
1.1k stars 179 forks source link

React Virtual DOM sorting doesn't change order / prevents any onClick handlers on children #229

Open kubjak opened 2 years ago

kubjak commented 2 years ago

If any element inside table row is having onClick function attached, forked some table-sort-js Codesanbox example:

https://codesandbox.io/s/register-form-forked-2z8bn9?file=/CTable.js

If you attach anything directy to element, click handler works, but doesn't sort / or update in DOM. If you attach a onClick on any button, after sorting this doesn't handle anymore.

Steps to reproduce:

  1. Try clicking button first to see alert message (works)
  2. Sort any column
  3. Try clicking button again (doesn't work)