keep scroll position
This commit is contained in:
@@ -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, () => {
|
||||||
|
|||||||
@@ -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, () => {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
Reference in New Issue
Block a user