Skip to content

Commit

Permalink
fix: prevent sorting when resizing column (#2149)
Browse files Browse the repository at this point in the history
* fix: prevent sorting when resizing column
  • Loading branch information
felix-ico authored Oct 4, 2023
1 parent 8e729ca commit e78af7c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions packages/components/src/components/data-grid/data-grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1021,12 +1021,15 @@ export class DataGrid {
);
}
},
onClick: () => {
this.toggleTableSorting(
sortDirection,
columnIndex,
type
);
onClick: (e) => {
const clickedElement = e.target as HTMLElement;
if (!clickedElement.matches('.thead__divider')) {
this.toggleTableSorting(
sortDirection,
columnIndex,
type
);
}
},
tabindex: 0,
class: `${props.class} thead-sortable`,
Expand Down

0 comments on commit e78af7c

Please sign in to comment.