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] Safari workaround for cell actions hover animation #6881

Merged
merged 3 commits into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/components/datagrid/_data_grid_data_row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,22 @@
animation-delay: $euiAnimSpeedNormal;
animation-fill-mode: forwards;
}
/*
* For some incredibly bizarre reason, Safari doesn't correctly update the flex
* width of the content (when rows are an undefined height/single flex row),
* which causes the action icons to overlap & makes the content less readable.
* This workaround "animation" forces a rerender of the flex content width
*
* TODO: Remove this workaround once https://bugs.webkit.org/show_bug.cgi?id=258539 is resolved
*/
.euiDataGridRowCell__expandContent {
animation-name: euiDataGridCellActionsSafariWorkaround;
animation-duration: 1000ms; // I don't know why the duration matters or why it being longer works more consistently 🥲
animation-delay: $euiAnimSpeedNormal + $euiAnimSpeedExtraFast; // Wait for above animation to finish
animation-iteration-count: 1;
animation-fill-mode: forwards;
animation-timing-function: linear;
}
}

// On focus, directly show action buttons (without animation)
Expand Down Expand Up @@ -243,3 +259,14 @@
width: $euiSizeM;
}
}
@keyframes euiDataGridCellActionsSafariWorkaround {
from {
width: 100%;
flex-basis: 100%;
}

to {
width: auto;
flex-basis: auto;
}
}
3 changes: 3 additions & 0 deletions upcoming_changelogs/6881.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

- Fixed Safari-only bug for single-line row `EuiDataGrid`s, where cell actions on hover would overlap instead of pushing content to the left