Script Doesnt Load When Using Modals

I created a filament custom field. It needs an external script to work so i add it at the bottom of the component

So far works, cool.

But now im using the field in a modal. and there, it doesnt work. the script is not being loaded.

so the question is, how to load the script when the field is inside a modal?

i've tried to remove the async and defer, but the result is the same:
<script src="https://maps.googleapis.com/maps/api/js?key={{ env('GOOGLE_MAPS_KEY') }}&libraries=places" async defer></script>
Screenshot_2024-07-03_at_09.15.51.png
Was this page helpful?