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

Prevent unit tests from failing because of non-standard method of HTML-element not present in js-dom

Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
Iku-turso 2022-03-23 09:55:42 +02:00 committed by Janne Savolainen
parent 9a5a210ed3
commit 836c2c1dbf
No known key found for this signature in database
GPG Key ID: 8C6CFB2FFFE8F68A

View File

@ -57,9 +57,9 @@ const NonInjectedLogsDockTab = observer(({ className, tab, model, subscribeStore
setTimeout(() => {
const overlay = document.querySelector(".PodLogs .list span.active");
if (typeof overlay?.scrollIntoViewIfNeeded === "function") {
overlay.scrollIntoViewIfNeeded();
}
if (!overlay) return;
// Note: .scrollIntoViewIfNeeded() is non-standard and thus not present in js-dom.
overlay?.scrollIntoViewIfNeeded?.();
}, 100);
};