payload icon indicating copy to clipboard operation
payload copied to clipboard

Edit and Live Preview Views Not Persisting State

Open tsemachh opened this issue 5 months ago • 5 comments

Link to reproduction

No response

Environment Info

Payload Version
3.0.0-beta.101

Node Version
v.22.8.0

Next.js Version
15.0.0-canary.104

Describe the Bug

As an author working on my content when I move between Edit and Live Preview the system ask me if I want to save changes. My expectation as a user that data will be persisted between the Edit and Live Preview as Live Preview also enables same editing experience as a User .

Here are some examples of apps that typically persist changes across Edit and Live Preview views:

Content Management Systems (CMS):

WordPress: When switching between the Visual Editor and Text Editor, changes are preserved. Drupal: The same applies to the WYSIWYG editor and HTML editor in Drupal. Joomla: Editing content in Joomla's Article Manager or other components usually maintains state across views.

Design Tools:

Figma: Switching between Design and Preview modes in Figma preserves your design elements and changes. Adobe XD: Similar to Figma, Adobe XD maintains design state across Edit and Preview modes. Sketch: Changes made in Sketch's Design mode are reflected in Preview mode and vice versa.

Web Development Environments:

CodePen: When you switch between the Edit and Preview panes in CodePen, your code changes are instantly reflected in the preview. JSFiddle: JSFiddle also maintains code changes across the Edit and Result panes.

Other Examples:

Google Docs: Switching between Edit and View mode in Google Docs preserves your document's content and formatting. Microsoft Word: Similar to Google Docs, Word maintains changes across Edit and Read modes.

Reproduction Steps

Open the Website template

  1. Create a new post or edit an existing one.
  2. Make changes to the content.
  3. Switch between the Edit and Live Preview views.
  4. Observe that the changes made in one view are not reflected in the other.

Expected Behavior:

When switching between Edit and Live Preview views, the current state of the entry (including any changes made) should be persisted and displayed correctly in both views.

Actual Behavior:

The changes made in one view are not reflected in the other, leading to inconsistent content display and potential data loss.

Adapters and Plugins

No response

tsemachh avatar Sep 10 '24 08:09 tsemachh