hotwired-laravel / turbo-laravel

This package gives you a set of conventions to make the most out of Hotwire in Laravel.
https://turbo-laravel.com
MIT License
803 stars 50 forks source link

Turbo Add hidden class to All SVG #78

Closed stevebrainng closed 2 years ago

stevebrainng commented 2 years ago

Hi Tony, Thanks for the update.

I don't know why Turbo add "hidden" class to all svg on the page on rendering. Meaning on first load the svgs shows and after the first load when navigating to other pages Svg are not showing

tonysm commented 2 years ago

Uhm, that's not possible, there is no CSS in the package nor in Turbo.js itself.

Turbo hijacks your links and forms and turns them into Ajax requests, so if you have things like listening the DOMContentLoaded event or something, you may need to change that to listen to turbo:load instead.

Not sure how you're loading your SVGs, so can't help that much. If you could provide a sample application where you're able to reproduce the issue, I wouldn't mind taking a look.

I'll close the issue for now, but if you think it's still related, feel free to reopen it or create a new one.