-
DescriptionWhen navigating with browser back/forward buttons, Alpine.js component states (like opened modals, accordions, datepickers etc.) persist because the page is loaded from the browser's back-forward cache (bfcache). This creates a poor user experience as components appear in their previous state before Alpine.js can reinitialize them. Examples
Expected BehaviorWhen navigating back/forward:
InvestigationWe've tried several approaches but haven't found a clean solution that prevents the state persistence. The main challenge seems to be that the browser restores the DOM state from bfcache before Alpine.js has a chance to initialize. QuestionWhat's the recommended way to handle component states when pages are loaded from bfcache? Environment
|
Beta Was this translation helpful? Give feedback.
axzilla/templui#27