Code Monkey home page Code Monkey logo

Comments (7)

pspeter3 avatar pspeter3 commented on June 7, 2024

Would you take a Pull Request for this?

from alpine-turbo-drive-adapter.

SimoTod avatar SimoTod commented on June 7, 2024

Yeah, sure. It may need some thinking and discussion though because it might not be the desired behavior.
For example, a sidebar menu, you click on something, a flag is set to true to show the menu then you click on a link to navigate away, when you navigate back you won't expect the sidebar to be open.
What do you think? Maybe we should cache them only if there is a specific attribute.

from alpine-turbo-drive-adapter.

pspeter3 avatar pspeter3 commented on June 7, 2024

I actually think in that case the state should be preserved on the back button in that case. I do worry about how it will work with removing Alpine generated DOM nodes.

from alpine-turbo-drive-adapter.

SimoTod avatar SimoTod commented on June 7, 2024

I'm not sure people would agree, if they hit back and a modal was already open, I think they would report it as a bug

from alpine-turbo-drive-adapter.

bep avatar bep commented on June 7, 2024

So, I've been using data-turbolinks-permanent to preserve client state across navigation, but I can see how the "back button" would semantically be different than clicking on a link ("get me back to my previous state.") In 99% of the cases I suspect that wold be the correct/expected behaviour, but don't think you could add something like this without a way of opting out of it.

from alpine-turbo-drive-adapter.

SimoTod avatar SimoTod commented on June 7, 2024

yeah, I'm not convinced because stuff like modals and submenus could open when you go back menu if you clicked on a link inside them which feels a bit weird. I'm trying to understand if it's perceived as an issue at the moment before doing anything.
As you said, if I ever add anything will be either an opt-out (data-alpine-no_cache) or maybe even an opt-in mechanism so people don't get errors if they update without reading the release notes.
I'm still thinking about it for now.

from alpine-turbo-drive-adapter.

SimoTod avatar SimoTod commented on June 7, 2024

Closing for now. The unexpected side effects are far worse than the benefits.

from alpine-turbo-drive-adapter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.