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

[EuiBasicTable] Fixed clickable rows not highlighting in sub-tables #4566

Merged
merged 27 commits into from
Mar 3, 2021

Conversation

anuragxxd
Copy link
Contributor

@anuragxxd anuragxxd commented Feb 23, 2021

Summary

Fixed the problem to the sub-tables not showing the hover effect.
Fixes #3923
CodeSandBox: https://codesandbox.io/s/row-highlighting-bug-2r55i?file=/src/index.js:252-1582

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Safari, 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

@thompsongl thompsongl requested a review from cchaos February 23, 2021 15:02
@kibanamachine
Copy link

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

@anuragxxd
Copy link
Contributor Author

@cchaos can you please review this :)

@cchaos
Copy link
Contributor

cchaos commented Feb 23, 2021

Yep, we'll get to it. We appreciate your patience with us. Also, don't forget to start new branches from the latest EUI master branch so that your PR commit log is clean and only contains those pertaining to this PR.

@cchaos
Copy link
Contributor

cchaos commented Feb 23, 2021

This one is going to require a little more work to test as we don't have an exact example in our docs to test with. At first glance though, the style changes are too heavy handed on the expanded row contents. The row contents should not have the hover affect but keep the shaded background color constant.

Screen.Recording.2021-02-23.at.12.40.20.PM.mp4

@anuragxxd
Copy link
Contributor Author

anuragxxd commented Feb 23, 2021

@cchaos I have made the example of this on my machine. Maybe if you want I can add that to the pr. It will also be good for future. :)
Regarding the master branch I am sorry for that I accidentally made extra commit to the master I have another pr on hold merging it will solve the issue (#4549). :-\

@cchaos
Copy link
Contributor

cchaos commented Feb 24, 2021

My only concern with adding this as a specific example is that it's not a great UI pattern so I don't want to necessarily promote it through our docs. But what we've done in the past is push an example up in the PR to make testing easier, but mark it as something to revert before merge. I'd be good with that approach for this PR if you want to just push your docs example with the commit message of To Revert: Testing example

@anuragxxd
Copy link
Contributor Author

@cchaos Temporally changed the 1st example for testing. Once you feel okay with it I will revert the change.

@cchaos
Copy link
Contributor

cchaos commented Feb 25, 2021

Thanks! Can you also address my previous comment about highlighting the expanded row content?

@anuragxxd
Copy link
Contributor Author

Isn't this little contradictory that in one we will be setting the background-color property to none and in one we want this to be $euiTableHoverColor. @cchaos

@cchaos
Copy link
Contributor

cchaos commented Feb 25, 2021

So the original issue is about how nesting a table specifically within a collapsible row doesn't get the right row hover behavior. But the fix shouldn't affect how other content currently gets displayed like in the original doc example which is just a description list.

By default, expanded row content should be a static gray background (no hover effect). But if a table lives within this expanded row content, it should properly handle it's own row hover behavior. Instead it's getting it's cell background color from the .euiTableRow.euiTableRow-isExpandedRow .euiTableRowCell selector which simply needs to be changed to be a direct descendent .euiTableRow.euiTableRow-isExpandedRow > .euiTableRowCell

Screen.Recording.2021-02-25.at.01.26.16.PM.mp4

@anuragxxd
Copy link
Contributor Author

@cchaos Done everything you asked for. Hope all good now. :\

@cchaos
Copy link
Contributor

cchaos commented Feb 25, 2021

Jenkins, test this

@kibanamachine
Copy link

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

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

Thanks! It looks like this approach works as well. Just some suggestions to cleanup the sass and then be sure to go through the PR checklist.

anuragxxd and others added 2 commits February 26, 2021 03:34
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
Co-authored-by: Caroline Horn <549577+cchaos@users.noreply.github.com>
@anuragxxd
Copy link
Contributor Author

Thanks @cchaos for so much help! I will revert the example once you tell me. :)

@anuragxxd
Copy link
Contributor Author

@cchaos Should I revert the changes of adding example?

@cchaos
Copy link
Contributor

cchaos commented Mar 1, 2021

Jenkins, test this

@kibanamachine
Copy link

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

@cchaos cchaos changed the title [EuiBasicTable] Clickable rows do not highlight in sub-tables [EuiBasicTable] Fixed clickable rows not highlighting in sub-tables Mar 2, 2021
Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

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

👍 Changes look good to me. Now just be sure to go through the PR checklist and you can revert the doc change too. Thanks!

@anuragxxd
Copy link
Contributor Author

Reverted the changes @cchaos

@cchaos
Copy link
Contributor

cchaos commented Mar 2, 2021

Great, just need to finish up the rest of the PR checklist! See the PR summary.

@cchaos
Copy link
Contributor

cchaos commented Mar 3, 2021

Jenkins, test this

@kibanamachine
Copy link

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

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.

[EuiBasicTable] Clickable rows do not highlight in sub-tables
4 participants