diff --git a/src/renderer/components/dock/pod-logs.tsx b/src/renderer/components/dock/pod-logs.tsx index 2336f55afe..5c642974e1 100644 --- a/src/renderer/components/dock/pod-logs.tsx +++ b/src/renderer/components/dock/pod-logs.tsx @@ -118,8 +118,8 @@ export class PodLogs extends React.Component { @autobind() toOverlay() { const { activeOverlayLine } = searchStore; - if (!this.virtualListRef.current || activeOverlayLine == -1) return; - this.virtualListRef.current.scrollToItem(activeOverlayLine); + if (!this.virtualListRef.current || activeOverlayLine === undefined) return; + this.virtualListRef.current.scrollToItem(activeOverlayLine, "center"); } /** diff --git a/src/renderer/components/dock/search.store.ts b/src/renderer/components/dock/search.store.ts index 1759767372..1b0bae31dc 100644 --- a/src/renderer/components/dock/search.store.ts +++ b/src/renderer/components/dock/search.store.ts @@ -106,9 +106,10 @@ export class SearchStore { return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); } + @action reset() { this.searchQuery = ""; - this.activeOverlayIndex = -1 + this.activeOverlayIndex = -1; } } diff --git a/src/renderer/components/virtual-list/virtual-list.tsx b/src/renderer/components/virtual-list/virtual-list.tsx index 73dd4201ba..d570760140 100644 --- a/src/renderer/components/virtual-list/virtual-list.tsx +++ b/src/renderer/components/virtual-list/virtual-list.tsx @@ -4,7 +4,7 @@ import "./virtual-list.scss"; import React, { Component } from "react"; import { observer } from "mobx-react"; -import { ListChildComponentProps, VariableSizeList } from "react-window"; +import { Align, ListChildComponentProps, VariableSizeList } from "react-window"; import { cssNames, noop } from "../../utils"; import { TableRowProps } from "../table/table-row"; import { ItemObject } from "../../item.store"; @@ -83,8 +83,8 @@ export class VirtualList extends Component { this.listRef.current.scrollToItem(index, "start"); }) - scrollToItem = (index: number) => { - this.listRef.current.scrollToItem(index) + scrollToItem = (index: number, align: Align) => { + this.listRef.current.scrollToItem(index, align) } render() {