avo-hq/avo

Alert users when they're navigating away from a form that has unsaved changes

開放

#673 建立於 2022年2月17日

 (3 則留言) (0 個反應) (1 位負責人)Ruby (308 個分叉)user submission
Avo 2Avo 3EnhancementFront endGood first issueHelp wantedStale exempthacktoberfest

倉庫指標

星標
 (1,778 顆星)
PR 合併指標
 (平均合併 1天 6小時) (30 天內合併 67 個 PR)

描述

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.

貢獻者指南