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

[Bug]: PhoneNumber form field masking interferes with unsavedChangesAlerts() in Filament 3 #5

Open
ChrisHardie opened this issue Aug 29, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ChrisHardie
Copy link

ChrisHardie commented Aug 29, 2024

What happened?

From what I can tell the masking setup in the PhoneNumber form field is manipulating the form/dom in a way that triggers the "Are you sure you want to leave this page with unsaved changes?" alerts made possible by the unsavedChangesAlerts() panel attribute in Filament v3, even if the field is not touched/edited in any way.

How to reproduce the bug

Set up a resource form that uses the PhoneNumber field and enable unsavedChangesAlerts(). Load a "create record" form in Filament and then navigate away from it. Observe that the unsaved changes warning is triggered. Repeat the same with an edit resource form, attempting to navigate away from it without making changes.

Package Version

1.0.2

PHP Version

8.1

Laravel Version

10.48

Which operating systems does with happen with?

No response

Notes

I was able to mitigate this to some degree on edit forms by specifying a mask attribute in my form definition that bypasses the package-provided method, e.g. ->mask('(999) 999-9999'). But this doesn't seem to help in the create form case, or when the phone number field is empty in the edit form case.

@ChrisHardie ChrisHardie added the bug Something isn't working label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant