Nialisc

Nialisc

Backward navigation persistent state

Hi there !
I’m currently building a music player with Liveview, but I’m facing a problem.
On the app, I have a player as a footer which have an audio tag. While navigating forward, Liveview will only patch the changed part of the DOM, so the player still play the current song.

But while navigating backward with the back button, the browser call the previous url and the server return the full page HTML which stop the current song from playing since the whole DOM is replaced. Does Liveview offers a solution that I have not found until now for that kind of use case ?

For example, Astro is able to do it with there “transition:persistent” directive that you can see in action here. Simply play a song and go back. But I can’t figure out how they are achieving this black magic and I’m really hoping for the same result in Liveview.

Marked As Solved

sodapopcan

sodapopcan

Hey there and welcome!

This article should help you out. TL;DR, use the sticky option :slight_smile:

Also Liked

Nialisc

Nialisc

This is exactly what I was looking for !
I don’t know how I didn’t saw it earlier. Thanks a lot :pray:

Last Post!

Nialisc

Nialisc

This is exactly what I was looking for !
I don’t know how I didn’t saw it earlier. Thanks a lot :pray:

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
New
jononomo
For some reason my phoenix channels are working for me in my local dev environment, but as soon as I deploy via Docker, I get a 403 error...
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement