1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Highlight virtual rows on hover

Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
Alex Andreev 2022-08-25 11:06:13 +03:00
parent 8ae993d8ea
commit 8d9ac313ad
3 changed files with 20 additions and 6 deletions

View File

@ -54,4 +54,22 @@
text-overflow: ellipsis;
white-space: nowrap;
}
// Virtual table styles
tbody > div {
position: absolute;
top: 0;
left: 0;
width: 100%;
display: flex;
padding: 0 calc(var(--padding) * 2);
&:hover {
background-color: var(--tableBgcSelected);
}
> div {
padding: 4px 0;
}
}
}

View File

@ -3,6 +3,7 @@
tr {
display: flex;
padding: 0 16px;
}
th {

View File

@ -25,7 +25,7 @@ import { prevDefault } from "../../utils";
estimateSize: () => 55,
overscan: 5,
count: rows.length,
paddingStart: 50 // header width
paddingStart: 50 // header height
})
return (
@ -46,12 +46,7 @@ import { prevDefault } from "../../utils";
key={virtualRow.index}
ref={virtualRow.measureElement}
style={{
position: 'absolute',
top: 0,
left: 0,
width: '100%',
transform: `translateY(${virtualRow.start}px)`,
display: 'flex',
cursor: onRowClick ? 'pointer' : 'default',
}}
onClick={prevDefault(() => onRowClick?.(row.original))}