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:
parent
8ae993d8ea
commit
8d9ac313ad
@ -54,4 +54,22 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
white-space: nowrap;
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
tr {
|
tr {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
padding: 0 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
th {
|
th {
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import { prevDefault } from "../../utils";
|
|||||||
estimateSize: () => 55,
|
estimateSize: () => 55,
|
||||||
overscan: 5,
|
overscan: 5,
|
||||||
count: rows.length,
|
count: rows.length,
|
||||||
paddingStart: 50 // header width
|
paddingStart: 50 // header height
|
||||||
})
|
})
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -46,12 +46,7 @@ import { prevDefault } from "../../utils";
|
|||||||
key={virtualRow.index}
|
key={virtualRow.index}
|
||||||
ref={virtualRow.measureElement}
|
ref={virtualRow.measureElement}
|
||||||
style={{
|
style={{
|
||||||
position: 'absolute',
|
|
||||||
top: 0,
|
|
||||||
left: 0,
|
|
||||||
width: '100%',
|
|
||||||
transform: `translateY(${virtualRow.start}px)`,
|
transform: `translateY(${virtualRow.start}px)`,
|
||||||
display: 'flex',
|
|
||||||
cursor: onRowClick ? 'pointer' : 'default',
|
cursor: onRowClick ? 'pointer' : 'default',
|
||||||
}}
|
}}
|
||||||
onClick={prevDefault(() => onRowClick?.(row.original))}
|
onClick={prevDefault(() => onRowClick?.(row.original))}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user