-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat: Add option to disable previous URL storage #82
Conversation
I have second thoughts on this topic. When working with htmx, we may often want the page loaded by the htmx request to be stored as the previous URL. My point is that in some cases this can be helpful, but for others, it will be a problem... so IMO we should make this option configurable. Maybe |
An example of specific cases? Yes, the setup is not a problem |
An example would be using htmx in the navigation to simply navigate to another page. In that case, we won't be storing the previous URL in the session at all. When AJAX headers are used, it is the user's choice. We will not override the default behavior of the framework. |
No 😄 . An example where the previous URL is needed. Plus, there are questions about the framework when working with browser tabs... there, too, the URL is overwritten. I'll update the PR tomorrow. I would be grateful if we discuss it in more detail. |
It is not important where it will be used, only whether it will return correct data. If you disable updating the previous URL for htmx requests, then it may have an incorrect value.
Yes, the same way as for traditional requests - we won't change that. |
777ca8c
to
573a4e7
Compare
You have almost completely corrected the PR. Fix it faster for you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You did 90% of the work here. Thank you.
@michalsn I caught BC 😄 So I haven't completely solved my problem. |
What is your problem? Sometimes you want to store the |
The example with pagination is simpler:
Now I have forgotten the exact example of the initial problem. But apparently this is not how it was planned. EDIT: A good solution is to use |
Why not use |
Let's leave this question for now. When I find the exact example, I'll come back. |
Closes #81
Copied
isWeb()
- it private methodThe test may be inaccurate, correct it