page.pageFrom not showing the correct page

in my page event im checking the previous page name using page.pageFrom

$$(document).on('page:afterin', '.page[data-name="StoreList"]', function (e, page) {

    console.log(page.pageFrom.name); => this show "Store" even if i was not coming from "Store" page.

    if (page.pageFrom.name != "Store") {
}

this happen if i use the back button multiple times then accessed the page with the attached event.

all my pages are stacked.

pageFrom’s data can be not really reliable as it can be affected by some aspects if you use stack pages or keepAlive. It is better to rely on router routeChange and routeChanged events https://framework7.io/docs/view.html#router-instance-events

1 Like