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
Is your feature request related to a problem? Please describe.
The new Copy/Paste feature in Sanity is awesome and is something I wanted for so long.
But it comes with an issue in our current project setup.
We have a hidden, read-only field in our document which gets its value from an initial value template. which means the field gets its value when the document is created and won't change afterward. The value is based on a dynamic parameter which is passed to the initial value template. So the same type of document can have different values based on where they appear on the desk structure.
The issue is that when we copy the whole document and paste it into a different document with the same type but has a different value in the above-mentioned field, the hidden field is also gets overwritten. The value is used for certain processes and this overwrite is messing up that logic.
Describe the solution you'd like
The solution I would suggest is to introduce a flag (like hidden and readOnly) to make the field immutable like the _id and _type properties. So that the copy feature ignores it.
Another solution would be re-use the readOnly flag to make the field immutable.
The text was updated successfully, but these errors were encountered:
I'm encountering the same issue. It also affects the hidden language field used by the official @sanity/document-internationalization. Looking forward to a solution :)
Is your feature request related to a problem? Please describe.
The new Copy/Paste feature in Sanity is awesome and is something I wanted for so long.
But it comes with an issue in our current project setup.
We have a hidden, read-only field in our document which gets its value from an initial value template. which means the field gets its value when the document is created and won't change afterward. The value is based on a dynamic parameter which is passed to the initial value template. So the same type of document can have different values based on where they appear on the desk structure.
The issue is that when we copy the whole document and paste it into a different document with the same type but has a different value in the above-mentioned field, the hidden field is also gets overwritten. The value is used for certain processes and this overwrite is messing up that logic.
Describe the solution you'd like
The solution I would suggest is to introduce a flag (like hidden and readOnly) to make the field immutable like the _id and _type properties. So that the copy feature ignores it.
Another solution would be re-use the readOnly flag to make the field immutable.
The text was updated successfully, but these errors were encountered: