cheesegrits/filament-phone-numbers

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

Opened this issue · 0 comments

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.