mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix scrolling to items on search
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
7b53650628
commit
05a3ed0e57
@ -81,8 +81,10 @@ export const LogList = observer(({ model }: LogListProps) => {
|
||||
}, [model.logTabData.get()]);
|
||||
|
||||
useEffect(() => {
|
||||
rowVirtualizer.scrollToIndex(model.searchStore.occurrences[model.searchStore.activeOverlayIndex], { align: 'end', smoothScroll: false });
|
||||
}, [model.searchStore.activeOverlayIndex])
|
||||
if (!model.searchStore.occurrences.length) return;
|
||||
|
||||
scrollTo(model.searchStore.occurrences[model.searchStore.activeOverlayIndex]);
|
||||
}, [model.searchStore.searchQuery, model.searchStore.activeOverlayIndex])
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@ -123,6 +123,8 @@ export class SearchStore {
|
||||
* @returns A line index within the text/logs array
|
||||
*/
|
||||
@computed get activeOverlayLine(): number {
|
||||
if (!this.occurrences.length) return -1;
|
||||
|
||||
return this.occurrences[this.activeOverlayIndex];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user