Compare commits

...

1 Commits

Author SHA1 Message Date
James
7584c0350f fix(ui): ensures join field state stays after form submission 2025-03-19 16:41:29 -04:00
2 changed files with 10 additions and 1 deletions

View File

@@ -77,7 +77,7 @@ export const mergeServerFormState = ({
* Handle adding all the remaining props that should be updated in the local form state from the server form state
*/
serverPropsToAccept.forEach((prop) => {
if (!dequal(incomingState[path]?.[prop], newFieldState[prop])) {
if (prop in incomingState && !dequal(incomingState[path]?.[prop], newFieldState[prop])) {
changed = true
fieldChanged = true
if (!(prop in incomingState[path])) {

View File

@@ -14,5 +14,14 @@ export const SelfJoins: CollectionConfig = {
on: 'rel',
collection: 'self-joins',
},
{
name: 'hideIfEmpty',
type: 'join',
on: 'rel',
collection: 'self-joins',
admin: {
condition: ({ hideIfEmpty }) => hideIfEmpty?.docs?.length > 0,
},
},
],
}