Preview button does not redirect if pressed while unsaved changes exist #7154
Labels
General Interface
Parts of the UI which don't fall neatly under other labels.
[Type] Bug
An existing feature does not function as intended
Related: #7124
Separate from publish preview task (#4099)
If the user hits the Preview button for a draft where unsaved changes exist, the preview window appears but the user is never redirected to the post.
Steps to reproduce:
Expected result:
Intermediary page appears, but eventually redirects to preview.
Actual result:
Redirect never occurs.
Workaround:
If the user first hits Save before Preview, then the preview loads correctly.
Suspected cause:
The logic for detecting whether a redirect should take place depends on the post's
modified
field being updated. This does not occur for autosaves. A preview is expected to be saved as an autosave (at least for published posts, which are not expected to be updated immediately).gutenberg/editor/components/post-preview-button/index.js
Lines 28 to 36 in e86d7b6
The text was updated successfully, but these errors were encountered: