avo-hq/avo
在 GitHub 查看Alert users when they're navigating away from a form that has unsaved changes
Open
#673 建立於 2022年2月17日
Avo 2Avo 3EnhancementFront endGood first issueHelp wantedStale exempthacktoberfest
描述
Feature
Whenever you go on an edit page and you start filling in the details for a record, you don't have anything to stop it from navigating away and losing all that data.
We should add something that stops the user from doing that with a dialog/alert box that says "Are you sure you want to navigate away from the page? You will lose all your changes."
- Check if the user made any changes. If not, then don't display any warning.
- If the user changed anything on the form, display the warning.
- Bonus: Submit form on CMD + Return
When a resource has a lot of fields and the edit form view is very long, it can be easy to forget to scroll back up to the top to hit save. It would be nice if resources had a configuration option that allowed for optionally displaying the save button at the bottom of the form as well.