keep scroll position
This commit is contained in:
@@ -150,7 +150,7 @@ let unregisterProductListEvent: (() => void) | undefined;
|
||||
let isDisposed = false;
|
||||
|
||||
function getProductListPage(): HTMLElement | null {
|
||||
return productListRef.value?.closest<HTMLElement>(".page") || null;
|
||||
return productListRef.value?.querySelector<HTMLElement>(".pull-refresh") || null;
|
||||
}
|
||||
|
||||
function savePageScrollPosition(): void {
|
||||
@@ -404,7 +404,9 @@ onActivated(() => {
|
||||
});
|
||||
|
||||
onDeactivated(() => {
|
||||
savePageScrollPosition();
|
||||
if (savedPageScrollTop === undefined) {
|
||||
savePageScrollPosition();
|
||||
}
|
||||
});
|
||||
|
||||
watch(keyword, () => {
|
||||
|
||||
@@ -124,7 +124,7 @@ let unregisterProductStockListEvent: (() => void) | undefined;
|
||||
let isDisposed = false;
|
||||
|
||||
function getProductStockListPage(): HTMLElement | null {
|
||||
return productStockListRef.value?.closest<HTMLElement>(".page") || null;
|
||||
return productStockListRef.value?.querySelector<HTMLElement>(".pull-refresh") || null;
|
||||
}
|
||||
|
||||
function savePageScrollPosition(): void {
|
||||
@@ -333,7 +333,9 @@ onActivated(() => {
|
||||
});
|
||||
|
||||
onDeactivated(() => {
|
||||
savePageScrollPosition();
|
||||
if (savedPageScrollTop === undefined) {
|
||||
savePageScrollPosition();
|
||||
}
|
||||
});
|
||||
|
||||
watch(keyword, () => {
|
||||
|
||||
Reference in New Issue
Block a user