keystonejs/keystone-classic

Prompt to save changes to a post before navigating away

開放

#4,491 建立於 2017年11月1日

 (0 則留言) (0 個反應) (0 位負責人)JavaScript (2,288 個分叉)batch import
feature requesthelp wanted

倉庫指標

星標
 (14,656 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Expected behavior

We should track when changes are made to the form since the last save, and if the user is navigating away from the edit page while there are unsaved changes, prompt them to save or to confirm their navigation action.

Actual/Current behavior

Current behavior is that there is no check for unsaved changes. If the user accidentally navigates away from the edit page, then these changes are lost.

Steps to reproduce the actual/current behavior

  1. Select a post from the admin page to edit
  2. On the edit screen, make some changes to the post
  3. Navigate away from the edit screen without clicking the save button

At this point, if you view the selected post, the unsaved changes will be lost.

Environment

Software Version
Keystone master branch of the repo (npm linked)
Node 6.11.2

貢獻者指南