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

[FEATURE]: Option not to disable TableHeadRow when there's no data #612

Closed
5 tasks done
philipnery opened this issue Jun 24, 2020 · 4 comments
Closed
5 tasks done
Assignees
Labels
enhancement New feature or request next The next version (beta)
Projects
Milestone

Comments

@philipnery
Copy link

Feature Check list

  • Agree to the Code of Conduct
  • Read the README to ensure the feature is not already present
  • You read Creating Issues, Features and Pull Requests
  • Considered the value versus complexity for all users of the library as well as library maintenance
  • Considered if this can be a storybook or documentation example

Is your feature request related to a problem? Please describe

We have buttons placed inside table row headers.

Unfortunately, if the table has no data (and we're using persistTableHead BTW), it gets disabled so we can't anymore click the buttons inside.

Describe the solution you'd like

Either we add another props for this or modify TableHeadRow's disabled when persistTableHead is true.

Maybe something like this?

                  <TableHeadRow
                    className="rdt_TableHeadRow"
                    role="row"
                    dense={dense}
                    disabled={progressPending || (data.length === 0 && !persistTableHead)}
                  >

Thanks,
Philip

@jbetancur
Copy link
Owner

Thanks for raising this. I've not has as much time as I'd like to work but I will try to get to it the next week. PR's are welcome if you'd like to contribute and get a fix in sooner.

@jbetancur jbetancur added the enhancement New feature or request label Jun 28, 2020
@jbetancur
Copy link
Owner

jbetancur commented Jun 28, 2020

Can you share code or preferable a codesandbox https://codesandbox.io/embed/react-data-table-sandbox-ccyuu of how you are adding elements to TableHeadRow?

TableHeadRow is meant to be internally controlled.

In any case, I think the disabled can be moved to TableCol ColumnSortable since it is the sort button that should be disabled or hidden if there is nothing to sort.

@mathieupetrini
Copy link

Thanks for your library.
Any updates on this ?

@jbetancur jbetancur self-assigned this Dec 29, 2020
@jbetancur jbetancur added this to the RDT Next milestone Dec 29, 2020
@jbetancur jbetancur added the next The next version (beta) label Dec 29, 2020
@jbetancur jbetancur added this to To do in RDT Next 7 Dec 29, 2020
@jbetancur jbetancur moved this from To do to In progress in RDT Next 7 Jan 21, 2021
@jbetancur jbetancur moved this from In progress to To do in RDT Next 7 Jan 21, 2021
@jbetancur jbetancur moved this from To do to In progress in RDT Next 7 Feb 22, 2021
@jbetancur
Copy link
Owner

Implemented this in RDT next branch/alpha-6.
#776

RDT Next 7 automation moved this from In progress to Done Feb 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request next The next version (beta)
Projects
No open projects
RDT Next 7
  
Done
Development

No branches or pull requests

3 participants