React-table: Extra sorting action after resizing column.

Created on 13 Nov 2019  路  5Comments  路  Source: tannerlinsley/react-table

Describe the bug

When using both useResizeColumns and useSortBy like Examples in Documentation, Drag 'resizer' will trigger Header click events and do sort every time. Bubbling?

Expected behavior

Drag 'resizer' to resize column, NO SORT.

Codesandbox!

Edit tannerlinsley/react-table: column-resizing

Most helpful comment

You can solve this problem by taking different elements for header content on which you apply sort props and a sibling to it which applies resize props, something like https://codesandbox.io/s/tannerlinsleyreact-table-column-resizing-jel1b can help you.

All 5 comments

You can solve this problem by taking different elements for header content on which you apply sort props and a sibling to it which applies resize props, something like https://codesandbox.io/s/tannerlinsleyreact-table-column-resizing-jel1b can help you.

鈽濓笍 Well said. Apply the props to different elements.

@tannerlinsley Maybe this should be mentioned in the docs, but I'm not sure where exactly. I had to search the issues to find this information.

but it is working on my component. Thanks @gargroh

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dilipsundarraj1 picture dilipsundarraj1  路  3Comments

Codar97 picture Codar97  路  3Comments

esetnik picture esetnik  路  3Comments

missmellyg85 picture missmellyg85  路  3Comments

alexanderwhatley picture alexanderwhatley  路  3Comments