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(; => this show "Store" even if i was not coming from "Store" page.

    if ( != "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

1 Like