Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悶] actions from the Form are vanished in the history. #3149

Closed
genki opened this issue Feb 25, 2023 · 4 comments
Closed

[馃悶] actions from the Form are vanished in the history. #3149

genki opened this issue Feb 25, 2023 · 4 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Milestone

Comments

@genki
Copy link
Contributor

genki commented Feb 25, 2023

Which component is affected?

Qwik City (routing)

Describe the bug

When to make a search form with the form component, it seemed there is no way to record the action in the browser history.
Suppose a man has searched words "Foo", "Bar" and then "Baz" and wanted to back to the result of "Foo".
But if he clicked the back button then the browser shows the page everything has not happened yet.
I am wondering on it is designed behavior or a bug.

Reproduction

https://stackblitz.com/edit/qwik-starter-ry1wpp?file=src/routes/index.tsx

Steps to reproduce

Please go to the reproduction link and click the Open in New Tab button at the top rigth corner.
And then type some words and click "submit" button. You can find no history has made.
This is not depending on if reloadDocument is set or not.

System Info

System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M2
    Memory: 77.92 MB / 24.00 GB
    Shell: 3.5.1 - /opt/homebrew/bin/fish
  Binaries:
    Node: 19.5.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.3.1 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 110.0.5481.100
    Firefox: 110.0
    Safari: 16.2
  npmPackages:
    @builder.io/qwik: file:../clone/qwik/packages/qwik => 0.19.2 
    @builder.io/qwik-city: file:../clone/qwik/packages/qwik-city => 0.4.0 
    undici: ^5.20.0 => 5.20.0

Additional Information

No response

@genki genki added TYPE: bug Something isn't working STATUS-1: needs triage New issue which needs to be triaged labels Feb 25, 2023
@stackblitz
Copy link

stackblitz bot commented Feb 25, 2023

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

@genki
Copy link
Contributor Author

genki commented Feb 25, 2023

I think it is the best if there can be a way to store the states made by useStore or useSignal and viewing parameters such as the scroll position in the history and restore it when the browser goes back.

@gioboa
Copy link
Member

gioboa commented Aug 30, 2023

Hi @genki, thanks for opening this issue.
A lot of things happened during this months, with the latest version of Qwik is it still a valid issue?

@gioboa
Copy link
Member

gioboa commented Dec 24, 2023

@genki you can use useNavigate to add your query strings to the history.
with routeAction$ I didn't find the way to redirect to the same path + query strings
So I'm closing this issue for now, feel free to re-open it if it's still an issue for you.

@gioboa gioboa closed this as completed Dec 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants