Skip to content

bug: Ionic React routerDirection "none" causes BackButton to go to defaultHref #24074

Description

@babycourageous

Prerequisites

Ionic Framework Version

  • v4.x
  • v5.x
  • v6.x

Current Behavior

I think based on my understanding of the routerDirection prop, I think this may be a bug-

When routing via Item, Button, etc with routerLink and routerDirection if routerDirection is set to "none" the back button on the routed to page goes to the defaultHref instead of the page you came from.

ionic-direction-none.mov

Expected Behavior

BackButton should use history to determine where to go back to, even with "none" as routerDirection

Steps to Reproduce

Example REPO

From Tab 1 -
Button 1 routes as default with a forward direction and then you go back to Tab 1.
Button 2 routed with direction "none" and will then take you back to Tab 2 (the defaultHref for the Back Button)

Code Reproduction URL

https://github.com/babycourageous/ionic-router-direction-none-bug

Ionic Info

Ionic:

Ionic CLI : 6.17.1 (/Users/renedellefont/.fnm/node-versions/v14.17.6/installation/lib/node_modules/@ionic/cli)
Ionic Framework : @ionic/react 5.8.4

Capacitor:

Capacitor CLI : 3.2.5
@capacitor/android : not installed
@capacitor/core : 3.2.5
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 1.5.0

System:

NodeJS : v14.17.6 (/Users/renedellefont/.fnm/node-versions/v14.17.6/installation/bin/node)
npm : 6.14.15
OS : macOS Big Sur

Additional Information

If this is the intended behavior I can PR to the docs to perhaps clarify that section. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions