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

[Backport 1.x] Prevent action buttons of OuiDataGridCell from moving the content #1229

Merged
merged 1 commit into from
Feb 2, 2024
Merged
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
64 changes: 46 additions & 18 deletions src/components/datagrid/_data_grid_data_row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -165,17 +165,7 @@
align-items: baseline;
}

.ouiDataGridRowCell__expandButton {
display: flex;
flex-grow: 0;
}

.ouiDataGridRowCell__expandButtonIcon {
height: $ouiSizeM;
border-radius: calc($ouiBorderRadius / 2);
width: 0;
overflow: hidden;
transition: none; // Have to take out the generic transition so it is instaneous on focus
.ouiDataGridRowCell {
box-shadow: none !important; // sass-lint:disable-line no-important

/* ToDo: Remove unnecessary logic: the old beta theme has
Expand All @@ -190,14 +180,52 @@
margin-left: $ouiDataGridCellPaddingM;
width: $ouiSizeM;
}
}

.ouiDataGridRowCell__actionButtonIcon {
height: $ouiSizeM;
border-radius: calc($ouiBorderRadius / 2);
width: 0;
overflow: hidden;
transition: none; // Have to take out the generic transition so it is instaneous on focus
&__actionButtonIcon,
&__expandButtonIcon {
height: $ouiSizeM;
border-radius: calc($ouiBorderRadius / 2);
width: 0;
overflow: hidden;
transition: none; // Have to take out the generic transition so it is instantaneous on focus
}

&__expandButton > * {
z-index: 2;
}

&__expandButton {
display: flex;
flex-grow: 0;
position: absolute;
// Vertically align the button group with the first line of text
top: calc(#{$ouiLineHeight}em / 2 + #{$ouiDataGridCellPaddingM});
transform: translateY(-50%);
// Stick it to the right but use the padding of the container to distance it from the edge
right: 0;
padding-right: $ouiDataGridCellPaddingM;
z-index: 1;
// Just to have some distance from the content behind it; larger for left so we can show a gradiant
padding-left: 2 * $ouiDataGridCellPaddingM;
padding-top: $ouiDataGridCellPaddingM;
padding-bottom: $ouiDataGridCellPaddingM;

&::before {
content: '';
position: absolute;
display: block;
right: 0;
top: 0;
height: 100%;
width: 100%;
background-image: linear-gradient(to right, transparent 0, $ouiColorEmptyShade calc(2 * $ouiDataGridCellPaddingM));
z-index: 1;
}

& > * {
z-index: 2;
}
}
}

// Row highlights
Expand Down
Loading