filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
19.15k stars 2.95k forks source link

Unsaved alerts show always pops up even if no changes made when using `->mask()` #13844

Open akki-io opened 3 months ago

akki-io commented 3 months ago

Package

filament/filament

Package Version

v3.2.97

Laravel Version

v11.20.0

Livewire Version

v3.5.4

PHP Version

PHP 8.3.6

Problem description

When using ->mask() with a field that has unsavedChangesAlerts(), the alert Changes you made may not be saved. is always displayed when navigating away from the page, even if no changes were made.

image

Expected behavior

It should not show any unsaved alert if no changes are made.

Steps to reproduce

git clone git@github.com:akki-io/filament-issue-unsaved-alerts.git
cd filament-issue-unsaved-alerts
cp .env.example .env
composer install
php artisan key:generate
php artisan migrate --seed
php artisan serve
  1. Navigate to http://localhost:8000/admin
  2. Login using credentials: test@example.com + password
  3. Go to http://127.0.0.1:8000/admin/users/1/edit
  4. Click on any sidebar menu
  5. You will see the unsaved alert notification.

Reproduction repository (issue will be closed if this is not valid)

https://github.com/akki-io/filament-issue-unsaved-alerts

Relevant log output

No console log

Donate 💰 to fund this issue

Fund with Polar

akki-io commented 3 months ago

Relevant files are here