enhance(view):调整虚拟列表滚动设置,避免卡顿。

This commit is contained in:
徐涛 2023-03-23 08:47:03 +08:00
parent 6d4dd4de06
commit 65943e33b9
2 changed files with 2 additions and 3 deletions

View File

@ -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 });

View File

@ -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]);