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.
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
[EuiDataGrid][BugFix]: Fix visible overflowing truncated text #7793
[EuiDataGrid][BugFix]: Fix visible overflowing truncated text #7793
Changes from 9 commits
64b9fc8
9d2ffef
8bf1bbe
4e4ca05
d38aa3e
7553f40
25c4c71
48c934f
c47968c
3f67373
742961a
de2cfd5
9f0996d
bce20ea
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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 generally don't like adding additional wrappers but we need to separate the line-clamp from the padding to ensure that the truncated text is hidden.
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 think my hangup is... I just honestly don't feel like it's worth it 🙈 it feels like an outsized performance impact (extra DOM node per cell, which will scale enormously on datagrids) for what's purely a visual effect. I'm tempted to look into other approaches if possible (pseudo element that "covers" the text? some other overflow CSS workaround?)
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 found the world's hackiest CSS workaround using a transparent border! Let me know what you think? main...cee-chen:eui:datagrid/line-clamp-css-workaround
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.
Yeah, I totally agree - adding a wrapper is a big performance impact on DataGrid. That's why I'm also not really happy with it.
I checked your hacky workaround and it seems to work great! 🪄 I'd vote for that one as it's definitely way more lightweight 🪶 🎉
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.
One small downside I notice is that it does not currently update when changing the controls in the story (e.g.
gridStyle.fontSize
- it renders correctly on reload though.)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.
After poking at it, I think this is an issue in production datagrid because
gridStyles.fontSize
doesn't correctly update the expected row height on the production storybook either (which is the underlying issue).I'm not totally sure this is worth chasing down right now as consumers typically don't change custom
gridStyle.fontSize
on the fly (vs users using the density toolbar control). Am I way off on that?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 reverted the wrapper changes in favor of your suggested transparent border hack here in this commit.
I agree that the
gridStyle
issue is not a storybook issue but the prop generally doesn't trigger a recalculation.In general this should not be an issue, as production would likely never on the fly change the styles via
gridStyle
prop, but in Storybook it seems weird/broken as we showcase the prop object and IMHO it's not apparent it's expected to not update. 😐I gave it a quick shot to ensure the cell height calculation is triggered on fontSize and cellPadding change here in this commit. WDYT? (We don't have to implement this here if you don't agree with it, it's a suggestion in case we can fix it this way rather easily 🙂)
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 would kinda strongly prefer not to in this PR - if we do want to resolve it, I'd prefer it be a separate issue + PR to make it easy to roll back standalone if necessary.
For context, I'm generally paranoid/conservative about anything involving EuiDataGrid due to its scale which results in outsized rerender/performance issues, and the cascading impact the component has on power users.
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.
Sure, that's fair. I'll revert the last commit and move it to a separate PR then 🙂
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.
Reverted in this commit.
ℹ️ I added a separate issue for the
gridStyles
update.