IOW: If there is a table it doesn't hurt to be able to sort it by default.
The example is great! 10 lines... no wait... 30 lines... then you have something that... or no wait, it sorts numbers alphabetically. The cursor is wrong. There is no accessibility. The little arrows are missing ▲ ▼ did I pick the right ones? They look bulky, better add another span inside the th? Oh I clicked the th twice now the text is highlighted.
Why should I need to implement this myself? I'm not inventing anything new? I don't want to be dealing with colspan but we all know how it should work? I know its wrong but I usually leave out the <thead>, tables render just fine without it but when something generates tables like that the script needs to be re-examined to figure out why it doesn't work. There is some unknown number of other ways to break it.
A default implementation could deal with some common units out of the box. Monday could go in front of Tuesday, 50 cm could be smaller than 1 m, $100 could be bigger than $20. Just the simple obvious stuff. For everything else something like <th sort="foo"> with: foo = (a,b) => a.length - b.length
List items are a bit less obvious but I'm sure we can think of something sensible. Perhaps sorting by child class?
What is the drawback?
(Also, you can do an HTML table sort in about 10 pretty short lines of code[1], so this seems like a kind of weird hill to die on.)
[1]: https://stackoverflow.com/questions/14267781/sorting-html-ta...