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()]);
|
}, [model.logTabData.get()]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
rowVirtualizer.scrollToIndex(model.searchStore.occurrences[model.searchStore.activeOverlayIndex], { align: 'end', smoothScroll: false });
|
if (!model.searchStore.occurrences.length) return;
|
||||||
}, [model.searchStore.activeOverlayIndex])
|
|
||||||
|
scrollTo(model.searchStore.occurrences[model.searchStore.activeOverlayIndex]);
|
||||||
|
}, [model.searchStore.searchQuery, model.searchStore.activeOverlayIndex])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -123,6 +123,8 @@ export class SearchStore {
|
|||||||
* @returns A line index within the text/logs array
|
* @returns A line index within the text/logs array
|
||||||
*/
|
*/
|
||||||
@computed get activeOverlayLine(): number {
|
@computed get activeOverlayLine(): number {
|
||||||
|
if (!this.occurrences.length) return -1;
|
||||||
|
|
||||||
return this.occurrences[this.activeOverlayIndex];
|
return this.occurrences[this.activeOverlayIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user