-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
initCollapsed not always respected when collapsible is inside of array #5739
Comments
The same happens in existing posts, for any array item where the collapsed preference has not been saved yet. |
Aside: In our use-case it would be preferable if the preferences would not be persisted in the document creation page. |
We need to make sure that the preferences for fields only send if the document ID is present. This should be fixed with one small condition being added to the collapsible field as well as any other field level preferences. |
@DanRibbens that would be ideal. Although note that the issue in this bug report is not exactly that one. It is specifically related to preferences of collapsibles when used inside of array fields, and happens in existing documents as well, so they can probably be dealt with separately. It is a less important issue though. What you describe seems more important and would have the most impact in usability. |
Created another ticket to track that issue: #5747 |
Hey @franciscolourenco just looked into this and the root of the problem here is exactly what @DanRibbens suggested. In your screen recording I can see that your preferences doc has the |
I can reproduce this issue in an existing document, so it seems they are independent issues:
This issue seems minor, but still there: Existing.Document.mp4 |
Thank you for the follow-up 👍. @PatrikKozak can you look into this? |
@jacobsfletch @franciscolourenco Yup looking into this. |
Link to reproduction
https://github.com/franciscolourenco/payload/commits/reproduce-collapsibe-inside-array-initCollapsed-not-respected/
Describe the Bug
When a collapsible field is used inside of an array field, the
initCollapsed
option is not always respected. Particularly, after preferences have been saved for the array, but preferences for a specific array item collapsible have not been saved.The collapsible inside of an array item whose preferences have not been saved, should respect initCollapsed, however if always starts expanded.
To Reproduce
Screen.Recording.2024-04-09.at.11.57.37.mp4
Payload Version
2.12.1 (latest main)
Adapters and Plugins
No response
The text was updated successfully, but these errors were encountered: