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

feat(DataTable): allow additional contents to expand cells #5060

Merged
merged 15 commits into from
Jan 25, 2020

Conversation

asudoh
Copy link
Contributor

@asudoh asudoh commented Jan 16, 2020

This change adds children prop support to <TableExpandHeader>. This provides applications with more control so application can better describe the expand cell.

Fixes #5028.

Changelog

New

  • children prop support to <TableExpandHeader>.

Testing / Reviewing

Testing should make sure our data table is not broken.

This change adds `children` prop support to `<TableExpandHeader>`. This
provides applications with more control so application can better
describe the expand cell.

Fixes carbon-design-system#5028.
@asudoh asudoh requested review from emyarod and tw15egan January 16, 2020 07:43
@asudoh asudoh requested a review from a team as a code owner January 16, 2020 07:43
@asudoh asudoh requested a review from joshblack January 16, 2020 07:43
@netlify
Copy link

netlify bot commented Jan 16, 2020

Deploy preview for the-carbon-components ready!

Built with commit f8a2093

https://deploy-preview-5060--the-carbon-components.netlify.com

@netlify
Copy link

netlify bot commented Jan 16, 2020

Deploy preview for carbon-components-react ready!

Built with commit f8a2093

https://deploy-preview-5060--carbon-components-react.netlify.com

@netlify
Copy link

netlify bot commented Jan 16, 2020

Deploy preview for carbon-elements ready!

Built with commit f8a2093

https://deploy-preview-5060--carbon-elements.netlify.com

Copy link
Collaborator

@tw15egan tw15egan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@joshblack joshblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to add a prop type for children? If so, should it be PropTypes.string or PropTypes.node? 🤔

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, I'm leaning towards setting the children prop type to string based on current usage examples

@tw15egan
Copy link
Collaborator

If they are going to need to hide whatever text they place there for a11y purposes, they're going to have to pass in a node with a visually-hidden class, so I'm leaning towards node

@joshblack
Copy link
Contributor

If we're adding this for a11y should we wrap children in bx--assistive-text (or visually hidden) and set the prop type as string?

@tw15egan
Copy link
Collaborator

@joshblack depends on if this is the only use case we have for adding this text. If yes, then yeah we might as well hook it all up for them. Not sure if users will ever need this content to be visible

@joshblack
Copy link
Contributor

Totally fair!

Real quick, when looking at the original issue are they looking for the aria-label prop to label the button in the th?

@asudoh
Copy link
Contributor Author

asudoh commented Jan 20, 2020

Real quick, when looking at the original issue are they looking for the aria-label prop to label the button in the th?

Quick look at the original issue I couldn't find any mention of aria-label, but let us know if there was what led to such thoughts.

@joshblack
Copy link
Contributor

I think it's just me misunderstanding things, thanks for checking in! It does seem like we'd want to go down the route of giving the option to supply text to be announced by a screen reader but not necessarily have it visually rendered, would that make sense with how everyone is interpreting this with respect to the data table design?

@asudoh
Copy link
Contributor Author

asudoh commented Jan 21, 2020

It does seem like we'd want to go down the route of giving the option to supply text to be announced by a screen reader but not necessarily have it visually rendered, would that make sense with how everyone is interpreting this with respect to the data table design?

Looking at #5028, the hard requirement seems the ability for application to add text to table expand cells. It makes sense for the sake of flexibility. The specifics above may have some room for discussion, so what #5028 requests for sounds a good stop-gap.

@asudoh asudoh merged commit f3422c4 into carbon-design-system:master Jan 25, 2020
@asudoh asudoh deleted the table-expand-cell-contents branch January 25, 2020 00:42
This was referenced Feb 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data Table Expand Row needs the ability to add text (hidden or visual) to table header
4 participants