-
Notifications
You must be signed in to change notification settings - Fork 841
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
[Data Grid] Allow adding custom actions to DataGridCells and cell popover #3668
[Data Grid] Allow adding custom actions to DataGridCells and cell popover #3668
Conversation
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
this is fantastic! |
@kertal I noticed you have this in draft mode? Do you want a review? |
@snide I've experienced a performance when using this PR's modification in my Discover PR in Chrome. Start of the week it was gone, but now I know why, been using my non-retina monitor to debug it, so here is the issue how to reproduce it in the current EUI version: #3705 |
…-29-datagrid-expandbutton-hover
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
since #3726 was merged, performance is fine, so this is now ready for review |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
@cchaos I can't reproduce (tested in the Preview documentation change), in which browser do you experience this problem? |
I was also on the preview build and using Chrome. I can reliably reproduce this with the following steps:
|
@cchaos thx! I could reproduce it now! |
…thub.com:kertal/eui into kertal-pr-2020-06-29-datagrid-expandbutton-hover
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
So what happens is, that after closing the popover, which owns focus, focuses the expand button, and therefore this is displayed, changed the CSS to prevent this. thx for catching this! |
@chandlerprall I changed and it works! Hopefully last problem: how to satisfy TypeScript for the export interface EuiDataGridColumnCellActionProps {
/**
* The index of the row that contains cell's data
*/
rowIndex: number;
/**
* The id of the column that contains the cell's data
*/
columnId: string;
/**
* React component representing the action displayed in the cell
*/
Component: JSXElementConstructor<EuiButtonIconProps | EuiButtonEmptyProps>;
/**
* Determines whether the cell's action is displayed expanded (in the Popover)
*/
isExpanded: boolean;
} |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
…-29-datagrid-expandbutton-hover
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
jenkins test this |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
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.
Changes LGTM; pulled & tested locally. 🎉
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.
@kertal Row counter is starting at 0 for "paint", sent a suggestion.
Co-authored-by: Andrea Del Rio <[email protected]>
Co-authored-by: Andrea Del Rio <[email protected]>
Co-authored-by: Andrea Del Rio <[email protected]>
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.
LGTM 🎉
Preview documentation changes for this PR: https://eui.elastic.co/pr_3668/ |
Summary
This PR allows to specify custom actions for data grid cell by column. These actions are displayed when the mouse hovers the cell and clickable, and also displayed when the cell gains keyboard focus and can be triggered by keyboard actions in the popover.
Action triggered by mouse click
Action triggered by keyboard enter
Checklist
- [ ] Checked Code Sandbox works for the any docs examples