Bug Report
Ionic version:
[ ] 4.x
[x] 5.x
Current behavior:
The back button behavior works for most straightforward cases, but depending upon the sequence of the history, sometimes the route gets replaced instead of the router.back()
getting called.
Expected behavior:
router should go back() if an the available history entry is applicable.
Steps to reproduce:
clone and run test application, follow replication steps:
run ionic serve
- visit root at
localhost:8100
- You should be redirected to /A
- The back button at the top of the page is set to be disabled if the
$route.fullPath === history.state.back
. (If you’re navigating from page to page and never visiting the same page in a row, then we should expect the current path and the next back path to never be the same)
- Use the Page buttons to navigate through the following sequence (not limited to this sequence)
- Page B, Page C, Page B, Page A, Page B, Page C
- Press Back Button
- Route Should be /B and back button should be enabled
- Press Back Button
Expected
- Route should be /A and back button should be enabled
Actual
- Route is /A, but back button is disabled
Related
Ionic Back Button Issue with explanation: https://github.com/sheamusburns/issue-ionic-router-back-button
Related Form Post: https://forum.ionicframework.com/t/vue-router-history-not-updating-history-state-back-after-ion-back-button-default-click-event/203468
Other information:
N/A
Ionic info:
Ionic:
Ionic CLI : 6.12.3 (/Users/sheamusburns/.nvm/versions/node/v12.16.0/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/vue 5.5.2
Capacitor:
Capacitor CLI : 2.4.6
@capacitor/core : 2.4.6
Utility:
cordova-res : 0.15.2
native-run : not installed
System:
NodeJS : v12.16.0 (/Users/sheamusburns/.nvm/versions/node/v12.16.0/bin/node)
npm : 6.14.11
OS : macOS Big Sur
k. thanks @liamdebeasi let me know if there’s anything I can do to help.