theme-change icon indicating copy to clipboard operation
theme-change copied to clipboard

Support for Livewire 3 wire:navigate

Open rustynail1984 opened this issue 1 year ago • 1 comments

Toggle is not working after navigate in a Livewire 3 app using wire:navigate.. you need to use livewire:navigated instead of DOMContentLoaded

See here https://livewire.laravel.com/docs/navigate#dont-rely-on-domcontentloaded

rustynail1984 avatar Aug 27 '23 00:08 rustynail1984

@rustynail1984 Replace themeChange() with

addEventListener('livewired:navigated', () => {
  themeChange(false);
});

This also applies to anyone using turbo:

addEventListener("turbo:load", () => {
    themeChange(false);
})

joshleblanc avatar Jun 23 '24 14:06 joshleblanc