-
Notifications
You must be signed in to change notification settings - Fork 425
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
fix(core): inherit readOnly state from ancestors in copyPaste function #7643
base: next
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
No changes to documentation |
Component Testing Report Updated Oct 21, 2024 4:23 PM (UTC) ✅ All Tests Passed -- expand for details
|
⚡️ Editor Performance ReportUpdated Mon, 21 Oct 2024 16:26:40 GMT
Detailed information🏠 Reference resultThe performance result of
🧪 Experiment resultThe performance result of this branch
📚 Glossary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thank you!
Description
When pasting values into a field which inherits the
readOnly
from the parent this was not verified., so it was possible to paste into read only fields.This PR adds a function
resolveReadOnlyAncestor
to check if any ancestor of the path in which the user is pasting is read only, if it is, it won't allow pasting.E.g, pasting into
inheritedReadOnlyField
was allowed, the same is happening with arrays.Screen.Recording.2024-10-21.at.18.11.24.mov
What to review
Is the implementation correct? Accessing the parents using the
resolveReadOnlyAncestor
is that in line with the existing approaches?Testing
New tests have been added into the copy paste to guard this functionality.
You can test it manually visiting https://test-next-studio-git-sdx-1643.sanity.dev/test/structure/playlist;7d12a507-75ef-4e28-ace6-95c237092e2b and trying to copy-paste values into the disabled fields
Notes for release
fixes an issue in copy paste in which the
readOnly
state was not correctly inherited to the children fields.