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

unsavedChangesAlerts() on Simple (modal) resources #13990

Open
dharen008 opened this issue Aug 19, 2024 · 0 comments
Open

unsavedChangesAlerts() on Simple (modal) resources #13990

dharen008 opened this issue Aug 19, 2024 · 0 comments
Labels
Milestone

Comments

@dharen008
Copy link

dharen008 commented Aug 19, 2024

Package

filament/filament

Package Version

3.1

Laravel Version

11

Livewire Version

3

PHP Version

8.2

Problem description

This issue occurs only with Simple (modal) resources.

  1. The unsavedChangesAlerts() should only appear if new data has been entered. Currently, it shows even when no new data is added.
  2. On the View/infolist page, unsavedChangesAlerts() still appears if you reload or refresh the page.

Expected behavior

Expected Behavior for Simple (Modal) Resources

  1. Triggering unsavedChangesAlerts():
  • The unsavedChangesAlerts() function should only be triggered when there is a new or unsaved change in the data.
  • If no data has been added, modified, or removed, the alert should not appear.
  1. Behavior After Clicking the Button Without Closing the Modal:
  • If a user clicks the button but does not close the modal and then refreshes the page, the unsavedChangesAlerts() should not activate unless there are actual unsaved changes.
  1. Behavior on View/Infolist Pages:
  • When viewing or refreshing the View/infolist pages, unsavedChangesAlerts() should not be displayed, as these actions should not imply any unsaved changes.

This behavior ensures that users are only alerted when there is a legitimate risk of losing unsaved data, avoiding unnecessary warnings.

Steps to reproduce

Try it on my holiday Simple (modal) resources.

The problem happens after clicking the button, but not closing the modal. If you then refresh the page, the unsavedChangesAlerts() function triggers, even though no changes have been made. This can be seen here: https://app.screencast.com/06hEAEkreBfhN.

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

https://github.com/dharen008/demo

Relevant log output

No response

Donate 💰 to fund this issue

  • You can donate funding to this issue. We receive the money once the issue is completed & confirmed by you.
  • 100% of the funding will be distributed between the Filament core team to run all aspects of the project.
  • Thank you in advance for helping us make maintenance sustainable!
Fund with Polar
@danharrin danharrin added this to the v3 milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Todo
Development

No branches or pull requests

2 participants