I added ->unsavedChangesAlerts(); to the provider, I tested it and on new record saving it working perfectly but when I do the same on edit it won't.