Code Monkey home page Code Monkey logo

Comments (5)

cj avatar cj commented on August 23, 2024 1

@danjac Turbo has data-turbo-permanent https://turbo.hotwire.dev/handbook/building#persisting-elements-across-page-loads

from turbo.

danjac avatar danjac commented on August 23, 2024

One thing I've noticed with data-turbo-permanent vs data-turbolinks-permanent: while the HTML itself is preserved, there appears to be an issue with elements inside the data-turbo-permanent element (at least in Chromium browsers). Page transitions seem to cause a reset, reloading the element, so if for example the audio is playing it will restart. This was not an issue in Turbolinks 5.

from turbo.

danjac avatar danjac commented on August 23, 2024

Re audio: this appears to be similar to older Turbolinks issue here. Looks like workaround is to create the Audio element in Javascript rather than in the HTML (i.e. const audio = new Audio(...)) inside e.g. your Stimulus controller:

turbolinks/turbolinks#157

from turbo.

sstephenson avatar sstephenson commented on August 23, 2024

data-turbo-permanent has not been removed, it just doesn't (currently) work for frame or stream renders.

from turbo.

danjac avatar danjac commented on August 23, 2024

Is there an open issue for this?

from turbo.

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.