enhance(view):调整虚拟列表滚动设置,避免卡顿。
This commit is contained in:
		| @@ -25,7 +25,7 @@ export const ContinuationView: FC = () => { | ||||
|   useEffect(() => { | ||||
|     ebus?.addListener('navigate_offset', ({ filename }) => { | ||||
|       let index = indexOf(filename, pluck('filename', files)); | ||||
|       virtualListRef.current?.scrollToIndex({ index, align: 'start', behavior: 'smooth' }); | ||||
|       virtualListRef.current?.scrollToIndex({ index, align: 'start' }); | ||||
|     }); | ||||
|     ebus?.addListener('reset_views', () => { | ||||
|       virtualListRef.current?.scrollTo({ top: 0 }); | ||||
|   | ||||
| @@ -27,8 +27,7 @@ export const FileList: FC = () => { | ||||
|     let firstActivedIndex = indexOf(firstActived, pluck('filename', files)); | ||||
|     listRef.current?.scrollToIndex({ | ||||
|       index: firstActivedIndex, | ||||
|       align: 'center', | ||||
|       behavior: 'auto' | ||||
|       align: 'center' | ||||
|     }); | ||||
|   }, [activeFiles]); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user