Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using Filament in PWA mode, the phone fields don't work #66

Closed
jeffegiovani opened this issue Feb 11, 2025 · 5 comments · Fixed by #67
Closed

When using Filament in PWA mode, the phone fields don't work #66

jeffegiovani opened this issue Feb 11, 2025 · 5 comments · Fixed by #67

Comments

@jeffegiovani
Copy link

jeffegiovani commented Feb 11, 2025

Filament PHP version:
3.2.139

ysfkaya/filament-phone-input version:
2.2.7

When using Flament in PWA mode, the fields dont work, but work perfectly on refreshing the page.

@jeffegiovani
Copy link
Author

I upgraded to latest version (3.1.5) and gived the same error

@jeffegiovani jeffegiovani changed the title When usin Filament in PWA mode, the phone fields don't work When using Filament in PWA mode, the phone fields don't work Feb 12, 2025
@abbasmashaddy72
Copy link

abbasmashaddy72 commented Feb 21, 2025

Same as in SPA mode too: after refresh, it works fine:

filament-phone-input.js?v=3.1.5.0:1 Uncaught TypeError: Cannot set properties of undefined (setting 'disabled')
    at HTMLDocument.<anonymous> (filament-phone-input.js?v=3.1.5.0:1:617345)
    at dispatch2 (livewire.js?id=13b7c601:1386:8)
    at eval (eval at safeAsyncFunction (livewire.js?id=13b7c601:1174:21), <anonymous>:7:21)
    at livewire.js?id=13b7c601:1527:9
    at releaseNextTicks (livewire.js?id=13b7c601:1535:24)
    at livewire.js?id=13b7c601:1522:9

@ysfkaya
Copy link
Owner

ysfkaya commented Feb 21, 2025

Hello guys!

I think the async alpine version has been updated and the method of loading the assets called by the phone input has changed. [PR]

Can you extend the phone component view and make the following changes and check? I will update according to the situation.

phone-input-blade.php

             <div
                 class="w-full"
-                x-ignore
                 @if (FilamentView::hasSpaMode())
-                    {{-- format-ignore-start --}}ax-load="visible || event (ax-modal-opened)" {{-- format-ignore-end --}}
+                    {{-- format-ignore-start --}}x-load="visible || event (ax-modal-opened)" {{-- format-ignore-end --}}
                 @else
-                    ax-load
+                    x-load
                 @endif
-                ax-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('filament-phone-input', package: 'ysfkaya/filament-phone-input') }}"
+                x-load-src="{{ \Filament\Support\Facades\FilamentAsset::getAlpineComponentSrc('filament-phone-input', package: 'ysfkaya/filament-phone-input') }}"

@smiliyas
Copy link
Contributor

I can confirm this change fixes the current issue. I submitted PR [#67] for this.

@jeffegiovani
Copy link
Author

Yeahh!
It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants