Skip to content

Router misalignment with the History API when navigation is prevented #533

@Gust99

Description

@Gust99

Describe the bug

In a simple SPA app with solid and solidjs router, if I navigate from /home to /page1 to /page2 and then click the browser back button but cancel the navigation, the next time I click the browser back button if I confirm the navigation the destination page is /home and not /page1. The content of the corresponding page is also not being displayed.

Your Example Website or App

https://github.com/Gust99/solidjs-router-app

Steps to Reproduce the Bug or Issue

  1. Run npm run dev
  2. Go to localhost:5173
  3. Click the page1 link
  4. Click the page2 link
  5. Click the browser back button
  6. Cancel navigation
  7. Click again the browser back button
  8. Confirm navigation

Expected behavior

  • I should navigate to page1 after confirming the navigation the second time I try to go from page2 to page1.
  • The corresponding content of the route should be displayed.

Screenshots or Videos

Image

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: 138.0.7204.157

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions