Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clicking column headers selects their text #1850

Closed
dandv opened this issue Jan 14, 2020 · 2 comments
Closed

Clicking column headers selects their text #1850

dandv opened this issue Jan 14, 2020 · 2 comments

Comments

@dandv
Copy link

dandv commented Jan 14, 2020

Describe the bug
Clicking too fast on table headers to change the sort order, selects the column title.

To Reproduce

  1. Go to https://codesandbox.io/s/github/tannerlinsley/react-table/tree/master/examples/sorting
  2. Click twice in quick succession on any table header.
  3. Notice the selected text:
    image

Additional context
Column headings should probably have user-select: none;, like the Material Design table component or material-table.com. The interaction of clicking the header twice quickly is not uncommon at all, given that initially the column sort indicator is hidden, and the user doesn't know if after clicking the heading, the direction will be the one they want.

@francois-pasquier
Copy link

The best way to use this libary is by using useTable.
This way, you can do whatever you want with the css.

@tannerlinsley
Copy link
Collaborator

You can put the toggle props on any component or element you want, not just the header. Please see the advanced examples to see this in action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants