You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PayloadCMS admin interface consistently shows "unsaved changes" indicators immediately upon opening any document that contains Lexical rich text fields with blocks, even when no actual modifications have been made. This occurs every time the document is opened, making it impossible to distinguish real unsaved changes and these phantom changes.
Navigate away and return to edit the same document
Result: Admin UI immediately shows unsaved changes indicator without making any modifications
Debug Attempts So Far
Through debugging with beforeChange hooks, we observed what appears to be JSON property reordering in Lexical editor fields during form processing:
What We Observed:
Database Storage: Lexical JSON appears to be stored with properties in one order (e.g., {"tag": "h2", "type": "heading", "format": "start"})
Form Loading: When the form loads, the Lexical JSON seems to be re-serialized with different property order (e.g., {"type": "heading", "format": "start", "tag": "h2"})
Change Detection: The admin UI detects this as a change, possibly because JSON.stringify() produces different results
Fields That Seem Affected:
✅ Lexical Rich Text fields
❌ Regular blocks fields - NOT affected (work normally)
❌ Simple fields (text, number, etc.) - NOT affected
Important Note:
This issue only occurs with Lexical rich text fields and only when there are blocks used. Regular blocks fields work fine. The issue appears to be specific to how the Lexical editor handles JSON serialization.
Has anyone else experienced this and figured out a solution or workaround?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
The PayloadCMS admin interface consistently shows "unsaved changes" indicators immediately upon opening any document that contains Lexical rich text fields with blocks, even when no actual modifications have been made. This occurs every time the document is opened, making it impossible to distinguish real unsaved changes and these phantom changes.
Environment
PayloadCMS Version: 3.58.0 (latest)
Next.js Version: 15.3.0
React Version: 19.0.0
Database: PostgreSQL (via @payloadcms/db-postgres v3.58.0)
Editor: Lexical Rich Text Editor (@payloadcms/richtext-lexical v3.58.0)
Steps to Reproduce
Debug Attempts So Far
Through debugging with beforeChange hooks, we observed what appears to be JSON property reordering in Lexical editor fields during form processing:
What We Observed:
{"tag": "h2", "type": "heading", "format": "start"}
){"type": "heading", "format": "start", "tag": "h2"}
)JSON.stringify()
produces different resultsFields That Seem Affected:
Important Note:
This issue only occurs with Lexical rich text fields and only when there are blocks used. Regular blocks fields work fine. The issue appears to be specific to how the Lexical editor handles JSON serialization.
Has anyone else experienced this and figured out a solution or workaround?
Beta Was this translation helpful? Give feedback.
All reactions