LeeWannacott / table-sort-js

HTML table sorting with no dependencies.
https://cdn.jsdelivr.net/npm/table-sort-js@latest/table-sort.js
MIT License
76 stars 26 forks source link

Table arrows do not disappear #140

Open ccapndave opened 3 days ago

ccapndave commented 3 days ago

If I enable table-arrows, clicking on column 1 shows an arrow as expected. However, clicking on column 2 shows the arrow for column 2 and column 1. I think that only one arrow should be visible at a time.

LeeWannacott commented 3 days ago

@ccapndave which version is this? I did changes in the latest release for custom table arrows, so it might be a regression. Can you compare v1.21.0 to v1.22.1 ;I don't remember exactly what the behaviour was... 🛌🏻

ccapndave commented 3 days ago

Thanks for the quick response! This is on 1.22.1. I checked on 1.12.0 and the behaviour is the same.

LeeWannacott commented 3 days ago

@ccapndave I don't think the table arrows should disappear?, however if clicking on another column it should reset all table arrows to the neutral arrow before setting the arrow up/down on the column being sorted (I'm guessing this is what you want???); however, the current implementation should still apply when the "remember-sort" tag is applied (not that anybody probably uses this tag...).