Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBug: Editor fields not updating when linking between pages inside CMS #4147
Comments
Hi @mcintyre321, I think the issue might be that we're loading the entry on component mount: which might not happen when you link directly in the editor. You could try using a react router Link component by setting up the widget as a separate package exporting a react component: https://github.com/netlify/netlify-cms-widget-starter Another option would be to add |
Hi, and thanks for your quick response. I think this is technically a bug, the more I think about it. If I
I still get incorrectly displayed data, the Name field still says "Sentry" (so I don't think it's caused by my |
You'd need to do a refresh to make sure the component is remounted. In order to fix it we would need to extract some of the code for loading the entry and registering the navigation blocker ( )And run the relevant parts when the slug/collection changes. |
I am using Netlify-CMS to build a readonly site, so I am using custom components which don't allow editing instead of the default ones.
One of those controls is a link to another-page-in-the-app control, which I'm using where one might ordinarily have a relation widget.
Describe the bug
When I follow the link to the linked page, any fields which have the same name as on the previous page are not updated.
To Reproduce
https://cuzkv.csb.app/#/collections/teams/entries/Some%20Team
)Expected behaviour
page is the same as if you have pasted the https://cuzkv.csb.app/#/collections/teams/entries/Some%20Team url into browser
Actual behaviour
The 'Name' field still says "Sentry"
Expected behavior
The 'Name' field says "Some Team"
Applicable Versions:
https://codesandbox.io/s/cuzkv?file=/config.yml
Additional context
This is my custom widget. I wonder if I should be using a react router Link instead of an
a
but I don't know how to do that...