mirror of
https://github.com/hyperdxio/hyperdx
synced 2026-04-21 13:37:15 +00:00
fix: logtable scroll with highlighted line id (#415)
This commit is contained in:
parent
e26a6d2ee6
commit
ded8a77633
2 changed files with 15 additions and 1 deletions
5
.changeset/mean-ducks-share.md
Normal file
5
.changeset/mean-ducks-share.md
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hyperdx/app': patch
|
||||
---
|
||||
|
||||
fix: logtable scroll with highlighted line id
|
||||
|
|
@ -520,8 +520,15 @@ export const RawLogTable = memo(
|
|||
);
|
||||
|
||||
// Scroll to log id if it's not in window yet
|
||||
const [scrolledToHighlightedLine, setScrolledToHighlightedLine] =
|
||||
useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (highlightedLineId == null || rowVirtualizer == null) {
|
||||
if (
|
||||
scrolledToHighlightedLine ||
|
||||
highlightedLineId == null ||
|
||||
rowVirtualizer == null
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -529,6 +536,7 @@ export const RawLogTable = memo(
|
|||
if (rowIdx == -1) {
|
||||
fetchNextPage();
|
||||
} else {
|
||||
setScrolledToHighlightedLine(true);
|
||||
if (
|
||||
rowVirtualizer.getVirtualItems().find(l => l.index === rowIdx) == null
|
||||
) {
|
||||
|
|
@ -542,6 +550,7 @@ export const RawLogTable = memo(
|
|||
highlightedLineId,
|
||||
fetchNextPage,
|
||||
rowVirtualizer,
|
||||
scrolledToHighlightedLine,
|
||||
// Needed to make sure we call this again when the log search loading
|
||||
// state is done to fetch next page
|
||||
isLoading,
|
||||
|
|
|
|||
Loading…
Reference in a new issue