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;
|
||||
// Scroll vertically
|
||||
this.virtualListRef.current.scrollToItem(activeOverlayLine, "center");
|
||||
// Scroll horizontally
|
||||
const overlay = document.querySelector(".PodLogs .list span.active");
|
||||
if (!overlay) return;
|
||||
overlay.scrollIntoViewIfNeeded();
|
||||
// Scroll horizontally in timeout since virtual list need some time to prepare its contents
|
||||
setTimeout(() => {
|
||||
const overlay = document.querySelector(".PodLogs .list span.active");
|
||||
if (!overlay) return;
|
||||
overlay.scrollIntoViewIfNeeded();
|
||||
}, 100);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user