keep scroll position

This commit is contained in:
Timi
2026-10-29 12:00:38 +08:00
parent 04fd57a4c3
commit f51d62b7d4
3 changed files with 9 additions and 5 deletions
+4 -2
View File
@@ -150,7 +150,7 @@ let unregisterProductListEvent: (() => void) | undefined;
let isDisposed = false; let isDisposed = false;
function getProductListPage(): HTMLElement | null { function getProductListPage(): HTMLElement | null {
return productListRef.value?.closest<HTMLElement>(".page") || null; return productListRef.value?.querySelector<HTMLElement>(".pull-refresh") || null;
} }
function savePageScrollPosition(): void { function savePageScrollPosition(): void {
@@ -404,7 +404,9 @@ onActivated(() => {
}); });
onDeactivated(() => { onDeactivated(() => {
savePageScrollPosition(); if (savedPageScrollTop === undefined) {
savePageScrollPosition();
}
}); });
watch(keyword, () => { watch(keyword, () => {
+4 -2
View File
@@ -124,7 +124,7 @@ let unregisterProductStockListEvent: (() => void) | undefined;
let isDisposed = false; let isDisposed = false;
function getProductStockListPage(): HTMLElement | null { function getProductStockListPage(): HTMLElement | null {
return productStockListRef.value?.closest<HTMLElement>(".page") || null; return productStockListRef.value?.querySelector<HTMLElement>(".pull-refresh") || null;
} }
function savePageScrollPosition(): void { function savePageScrollPosition(): void {
@@ -333,7 +333,9 @@ onActivated(() => {
}); });
onDeactivated(() => { onDeactivated(() => {
savePageScrollPosition(); if (savedPageScrollTop === undefined) {
savePageScrollPosition();
}
}); });
watch(keyword, () => { watch(keyword, () => {
+1 -1
View File
@@ -167,7 +167,7 @@ let unregisterSalesOrderListEvent: (() => void) | undefined;
let isDisposed = false; let isDisposed = false;
function getSalesOrderPage(): HTMLElement | null { function getSalesOrderPage(): HTMLElement | null {
return salesOrderListRef.value?.closest<HTMLElement>(".page") || null; return salesOrderListRef.value?.querySelector<HTMLElement>(".pull-refresh") || null;
} }
function savePageScrollPosition(): void { function savePageScrollPosition(): void {