Skip to content

Commit

Permalink
table-sort.js: distinguishes a click from a selection
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Sep 13, 2023
1 parent fc1dfa7 commit 10eb446
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Tracy/assets/table-sort.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ class TableSort
{
static init() {
document.documentElement.addEventListener('click', (e) => {
if (e.target.matches('.tracy-sortable > :first-child > tr:first-child *')) {
if ((window.getSelection().type !== 'Range')
&& e.target.matches('.tracy-sortable > :first-child > tr:first-child *')
) {
TableSort.sort(e.target.closest('td,th'));
}
});
Expand Down

0 comments on commit 10eb446

Please sign in to comment.