mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Delaying horizontal scrolling
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
4caddf5046
commit
871173e5ca
@ -118,10 +118,12 @@ export class PodLogs extends React.Component<Props> {
|
|||||||
if (!this.virtualListRef.current || activeOverlayLine === undefined) return;
|
if (!this.virtualListRef.current || activeOverlayLine === undefined) return;
|
||||||
// Scroll vertically
|
// Scroll vertically
|
||||||
this.virtualListRef.current.scrollToItem(activeOverlayLine, "center");
|
this.virtualListRef.current.scrollToItem(activeOverlayLine, "center");
|
||||||
// Scroll horizontally
|
// Scroll horizontally in timeout since virtual list need some time to prepare its contents
|
||||||
const overlay = document.querySelector(".PodLogs .list span.active");
|
setTimeout(() => {
|
||||||
if (!overlay) return;
|
const overlay = document.querySelector(".PodLogs .list span.active");
|
||||||
overlay.scrollIntoViewIfNeeded();
|
if (!overlay) return;
|
||||||
|
overlay.scrollIntoViewIfNeeded();
|
||||||
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user