Skip to content

Commit

Permalink
[Fix] Improve top position calculation for table groups (#1992)
Browse files Browse the repository at this point in the history
  • Loading branch information
roubkar authored Jul 22, 2022
1 parent d060769 commit fcb2143
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
.ChartPopover {
pointer-events: none;
z-index: 5!important;
height: 200px; // To not block table scroll

> *:first-of-type {
height: 200px; // To not block table scroll
}

&__content {
transform: none!important;
Expand Down
13 changes: 9 additions & 4 deletions aim/web/ui/src/components/CustomTable/TableColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,9 @@ function Column({
break;
}
top +=
ROW_CELL_SIZE_CONFIG[rowHeightMode].groupMargin +
rowHeightMode;
(ROW_CELL_SIZE_CONFIG[rowHeightMode].groupMargin ?? 6) +
rowHeightMode +
1;
if (expanded[key]) {
top += data[key].items.length * rowHeightMode;
}
Expand Down Expand Up @@ -619,13 +620,17 @@ function Column({
{expanded[groupKey] && (
<>
{data[groupKey]?.items?.map((item, i) => {
let absoluteTop = 0;
let absoluteTop =
(ROW_CELL_SIZE_CONFIG[rowHeightMode].groupMargin ??
6) + rowHeightMode;
let top = 0;
for (let key in data) {
if (key === groupKey) {
break;
}

absoluteTop +=
(ROW_CELL_SIZE_CONFIG[rowHeightMode]
.groupMargin ?? 6) + rowHeightMode;
if (expanded[key]) {
absoluteTop +=
data[key].items.length * rowHeightMode;
Expand Down
2 changes: 1 addition & 1 deletion aim/web/ui/src/styles/components/_autocomplete.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
padding: 0;
}

.SelectForm__option {
.SelectForm__option, .Metrics__SelectForm__option {
display: flex;
width: 100%;
overflow: hidden;
Expand Down

0 comments on commit fcb2143

Please sign in to comment.