-
Notifications
You must be signed in to change notification settings - Fork 67
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
fix: removes TableCell wrapper #810
Conversation
src/DataTable/TableCell.jsx
Outdated
/** Class names for the td element */ | ||
className: PropTypes.string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fully aware of the problem here, but it might be good to name this like dataClassName
or tdClassName
or something?
Or pulling back, this distinction seems so minute - block level vs inline? Is that a real distinction we want to expose? Could we move the cellClassName
up to the td
level safely, to solve the same problem you are looking at? Or is that an API break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what the original justification was for adding the cellClassName
to the inline element vs the block element here, but I agree this feels a little redundant. Though, .pgn__data-table-cell-wrap
has some styling that we may want to override (ex. .pgn__data-table-cell-wrap
has a max-width
and I found an edX repo that overrides it to none).
My use case for exposing the td
element's className was to change its vertical alignment, which you can't access through the inline element.
I think given that there are use cases for both, it makes sense to expose both but update the names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need someone more in tune with paragon than me.
Is moving .pgn__data-table-cell-wrap
up to <td>
and dropping the <span>
altogether a bad idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tried to drop the span and update the styling and it didn't really go well, so I think that might be a bad idea
c1b0f3e
to
e8b5bf5
Compare
The code below seems to work locally without incorporating any breaking changes or the existing styles. @ciduarte I think the styling issues you were running into might have been that const TableCell = ({ getCellProps, render, column }) => (
<td {...getCellProps({ className: classNames('pgn__data-table-cell-wrap', column.cellClassName) })}>
{render('Cell')}
</td>
); .pgn__data-table-cell-wrap {
max-width: 20vw;
white-space: normal;
overflow: hidden;
text-overflow: ellipsis;
} All the current uses of The other current uses of |
@adamstankiewicz thanks for looking into this! I did try that yesterday, and didn't see any broken styling on the Paragon site. What I saw was specific to frontend-app-learning, and I couldn't get to the bottom of it so I assumed it would be an issue everywhere. Giving it a second look, I realized what was happening and this change feels safe to make! For the curious, this change was impacting some cells that used |
579b5da
to
0e7a228
Compare
0e7a228
to
5f33d88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5f33d88
to
ac9c0b9
Compare
🎉 This PR is included in version 16.13.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
<td>