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 authored and Janne Savolainen committed 2022-03-31 15:13:30 +03:00
1 parent 9a5a210ed3
commit 836c2c1dbf
1 file changed
+3 -3
+3 -3
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);
};