#Perist HTML element
2 messages · Page 1 of 1 (latest)
Astro's transition:persist directive allows you to persist components and HTML elements across page navigations. This means that instead of replacing them, these elements will continue to exist as you navigate to another page. This works for both forwards and backwards navigation. For example, a video element with the transition:persist directive will continue to play as you navigate to another page that contains the same video element.
However, it's important to note that not all state can be preserved in this way. The restart of CSS animations and the reload of iframes cannot be avoided during view transitions even when using transition:persist.
As for your question about web workers, the knowledge sources provided do not contain specific information about how web workers interact with persisted HTML elements during page transitions in Astro. Therefore, I can't provide a confident answer to your question.