More flexible Table.Head/Footer with [noCell] prop for better pinCols support#463
Merged
benjitrosch merged 4 commits intodaisyui:mainfrom Sep 18, 2024
Merged
More flexible Table.Head/Footer with [noCell] prop for better pinCols support#463benjitrosch merged 4 commits intodaisyui:mainfrom
benjitrosch merged 4 commits intodaisyui:mainfrom
Conversation
…g children, allowing customization of pinned headers everywhere without getting rid of existing wrapping functionality.
…h aren't the first child.
👷 Deploy Preview for react-daisyui processing.
|
✅ Deploy Preview for react-daisyui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Contributor
Author
|
Note that I didn't end up addressing the original comment I made about Table.Head not letting me pass Table.Row into it as I originally expected - the issue was actually that you can't customize the child cells. I left Table.Head & Footer with a tag within because it wasn't causing issues. Maybe one day someone would want to pass props into that tr, in which case we could just remove it and make devs have the same structure as Table.Body. |
haiderRizvii
approved these changes
Sep 15, 2024
This was referenced Sep 18, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses #462
Currently the Table.Head/Body/Row/Footer pattern is very rigid - always wrapping children with th/td tags in Head/Footer. We don't want to break backwards compatibility, so to enable better table customization this PR adds the noCell property to Table.Head, Row and Footer. This prop allows devs to disable internally wrapping th/td tags and pass th/td tags as children manually - but still keep the useful default behaviour.
This is useful because it lets devs pin th tags in a row at any location, not just the first child.
eg.
What you couldn't do but now can with noCell:
Also updated tests for Table.Head/Row/Footer to cover noCell cases AND updated the story with a robust example with staggered th tags when noCell is enabled.