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

[EuiDataGrid] Fixed: Cell styling retains when column position is changed #4601

Closed
wants to merge 5 commits into from

Conversation

akashgp09
Copy link
Contributor

@akashgp09 akashgp09 commented Mar 3, 2021

Summary

This PR Fixes: #4599

Fixed EuiDataGrid retaining cells style when column position is changed.

Approach: By adding a cleanup function inside the useEffect hook fixes this.

Screenshots

Before

ezgif-4-dda7a459aa3a

After

ezgif-4-ad1d55524d25

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome,Edge, and Firefox
    - [ ] Props have proper autodocs and playground toggles
    - [ ] Added documentation
    - [ ] Checked Code Sandbox works for the any docs examples
    - [ ] Added or updated jest tests
    -[ ] Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4601/

return () => {
setCellProps({
style: {
backgroundColor: 'transparent',
Copy link
Contributor

Choose a reason for hiding this comment

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

I'll leave it to @chandlerprall or @thompsongl on whether it's best to address this at the docs layer or in the component itself, but I think we're going to want to set this to the $euiColorEmptyShade color rather than transparent. This would be needed since the panel might carry a background.

image

@thompsongl thompsongl requested a review from chandlerprall March 4, 2021 14:23
@akashgp09
Copy link
Contributor Author

Fixed the issue with background: transparent.
@chandlerprall are the changes Ok ? or will they need to be address on the component side 🤔

@chandlerprall
Copy link
Contributor

@akashgp09 my apologies for missing this one; instead of requiring the application code to reset the cell props, we'll want to find a way in data_grid_cell.tsx to detect when the component changes to represent a different cell and reset the value there.

@cee-chen
Copy link
Contributor

Closing, this should have been addressed in source code in #5068

@cee-chen cee-chen closed this Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiDataGrid] Cell styling retains when column position is changed
6 participants