Skip to content

Back button does not change contents after form submission + link click #2063

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
unhammer opened this issue Apr 29, 2025 · 2 comments · May be fixed by #2066
Open

Back button does not change contents after form submission + link click #2063

unhammer opened this issue Apr 29, 2025 · 2 comments · May be fixed by #2066

Comments

@unhammer
Copy link
Collaborator

unhammer commented Apr 29, 2025

This demonstrates the problem:

back.mp4

ie. we do a submit, click a link, then try to go back.

expected: contents of Users index (url being /Users)

got: same contents for /ShowUser and /Users

Code is at https://github.com/unhammer/ihp-back-button-repro – I just did ihp-new, created a users table with a name column, a users controller and ran it. Nothing out of the ordinary there.
That repo is using newest ihp master, but the problem was there at least as far back as 1.0.1 and I think earlier versions too.
Happens in both firefox and chrome.

A workaround is to use formForWithoutJavascript, but that loses the "interactive" feel (downgrades to web 1.0 🖳). I'd love to be able to have both the js form submission and a working back button.

Possibly related:

@amitaibu
Copy link
Collaborator

I tried to fetch that repo but I get

[Web/FrontController.hs:8:1](http://localhost:8001/OpenEditor?path=Web/FrontController.hs&line=8&col=1)
    Could not find module `Web.Controller.User'.
    Use :set -v to see a list of the files searched for.
  |
8 | import Web.Controller.User
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^

So please commit those files as well.

Also, it should use IHP master so

https://github.com/unhammer/ihp-back-button-repro/blob/fe7ac76c334ab88c90ffc4e8e10bc80d38a3bf96/flake.nix#L3

-         ihp.url = "github:digitallyinduced/ihp/012c7a3c03437109426c64b7c98189b6d639ca44";
+         ihp.url = "github:digitallyinduced/ihp";

and then nix flake update

@unhammer
Copy link
Collaborator Author

unhammer commented Apr 30, 2025

doh, added the Web.Controller.User etc. files, and set the ihp.url to no commit (though that makes it less reproducible ;-) 012c7a3 is current master as of now)

@amitaibu amitaibu linked a pull request May 5, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants