-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collection items shows "UNSAVED CHANGES" while nothing is changed (when custom editor components are used inside a markdown field)) #2211
Comments
@bert-bruggeman not an issue? Sent with GitHawk |
After checking pages using some other custom editor components I noticed I only have the issue with this specific component (button, see the js code above)... I thought something was wrong in my code in the "toBlock" function, maybe an extra space or character but I can't seem to solve this... |
Update: when I set the editor to markdown mode, edit and save the content, closing it and open it again I don't have this issue... After toggling the editor to "rich text" and back to markdown the "UNSAVED CHANGES" message reappears while nothing is changed... |
Update 2: After searching what could cause this issue I have found the problem. For example: Content - shows "Unsaved Changes" while nothing is changed - issue!
Content - shows "Changes saved" - no issue!
|
Hmm yeah I see that now, thanks for narrowing it down! |
I'm having the same issue with my Netlify CMS, specifically with my blog post collection type. Any time I go into the blog the status changes from Save Changes to Unsaved Changes. I don't have special components in my editor, just a line of text. My other collections, which don't have a markdown editor do not throw this error. |
We have the same issue with other widgets, has to do with how default values are set and also syncing issues between stateful widgets and widgets that are entirely controlled by the CMS. Most widgets are the latter, but the Markdown widget actually maintains its own state and selectively updates the CMS state for performance reasons. |
Is there any way to avoid it until there's a fix? @erquhart |
Not really. Beside the editor showing "unsaved changes", specifically what user experience are you wanting to avoid? Sent with GitHawk |
It is just very confusing, especially for non-technical users, who quickly think that they have done something wrong. |
Gotcha, and totally agree. No workaround at the moment, but it's now on our radar 👍 |
Getting the same issue and tracked it down to the relation component:
It seems that there's about a half second delay in this field being populated, at which point the "Changes saved" message switches to "unsaved changes". Switching this component to a list fixed this for us, but we'd still like to use a collection at some point in the future. |
I am seeing the same, no custom components, with relations. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is there any plans for this to be fixed? It is related to: #1550, and we recently just came across this issue. |
Same here with simple files. I've narrowed it down too and in my case, with no custom component, I have the issue if the last element in my markdown body is an image . By deleting the last image, the issue disappears. |
I'm also seeing this issue |
This issue seems particularly tricky if you want to use Editorial Workflow because the editor prevents you from changing the status (to Ready, so that you can publish) if it thinks there are unsaved changes. In my case the issue was caused by the relation widget and we couldn't easily switch to a list as per @HMilbradt fix. I eventually solved the issue for our specific use case by wrapping the default relation widget in a custom widget that checks if the value has changed before updating anything. It feels like a bit of a hacky fix but works well for us. Until the API updates mentioned in #725 are implemented I'd be happy to share the code for that custom widget in a gist or something if it would be helpful to anyone. |
Hi, @sleepingkiwi! Would you mind to share the code? I'm facing this issue right now and we have to deliver this project next week. Thanks in advance! |
@carloscabral - no problem. I think this is the mimimum required to get it working: https://gist.github.com/sleepingkiwi/3a657951164da7d552c27a5ef27d18ca It stops the contents of the relation select visually loading until you interact with it but the values are still stored/saved regardless. You have to register the custom widget - if you're used to doing that it should all hopefully be straightforward if not I included some simple examples but there's also docs on the netlify cms site |
Thank you, @sleepingkiwi! |
I've wasn't able to reproduce the original issue here https://github.com/erezrokah/netlify-cms-reproductions/commits/netlify_cms/issue_2211. Since it looks like this issue can be reproduced in several ways, if you're experiencing it, can you share the relevant Note: if it happens with relations comment on this issue #725 |
@erezrokah I faced the same issue at #3039 with a really simple |
Reproduces on this branch: https://github.com/erezrokah/netlify-cms-reproductions/tree/netlify_cms/issue_3039 |
#3039 is related to the fact that slate runs default schema validation as a part of the Core plugin https://github.com/ianstormtaylor/slate/blob/a0b7976cb9a2812d8d96361e9993fe8853a2cc64/packages/slate/src/plugins/core.js#L96. Our doesn't conform to the schema thus forcing an update. Possible solutions:
|
Same here. Collections that have a "relation" widget just dont save. It's always with "Unsaved" status after click on save. (The page just reloads).
|
Describe the bug
Collection items shows "UNSAVED CHANGES" while nothing is changed (when custom editor components are used inside a markdown field))
To Reproduce
Create a collection with a body field and add content with a custom editor widget like "button", publish, go back to the overview and open the item again, while nothing is changed the top left "back button" message says "UNSAVED CHANGES".
Editor component
Content - markdown file (see content type below)
Config (cards content type)
Browsers: Firefox, Chrome (current versions)
CMS: current 2.8.0
The text was updated successfully, but these errors were encountered: