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] Remove cell actions onmouseleave #5120

Merged
merged 3 commits into from
Sep 2, 2021

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Sep 1, 2021

Summary

Fixes #5116

Datagrid cells avoid rendering their cell actions unless the cell is focused or the mouse cursor is over the cell. To handle the mouse hovering interaction, we set an internal state on the cell but never unset it when the mouse leaves, which left all the action DOM in place even when it's hidden. This PR resets that state onMouseLeave, removing the cell action buttons from the DOM when not needed.

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

@chandlerprall chandlerprall changed the title Remove datagrid cell actions onmouseleave [EuiDataGrid] Remove cell actions onmouseleave Sep 1, 2021
@kibanamachine
Copy link

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

@cchaos
Copy link
Contributor

cchaos commented Sep 1, 2021

Is it also possible to prevent the reanimation of the expand button when the cell is in focus?

Screen Recording 2021-09-01 at 10 54 22 AM

Copy link
Contributor

@cee-chen cee-chen left a comment

Choose a reason for hiding this comment

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

Not sure if we want to block this PR to figure out the animation issue Caroline highlighted, but code-wise at least this LGTM. Depending on whether this or #5125 gets in first, I can add a small .simulate unit test as well for this event.

@chandlerprall
Copy link
Contributor Author

chandlerprall commented Sep 2, 2021

Is it also possible to prevent the reanimation of the expand button when the cell is in focus?

I wasn't able to find an obvious quick fix, I'll see if there's not already an issue for that and if not, make one.

EDIT now tracked in #5134

@kibanamachine
Copy link

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

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 actions are always rendered
4 participants