Skip to content
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

Doesn't show popup when adding a new document on relationship field with autosave enabled #6887

Closed
tigersoft6084 opened this issue Jun 21, 2024 · 2 comments · Fixed by #7325
Labels

Comments

@tigersoft6084
Copy link

Link to reproduction

No response

Describe the Bug

If a collection has relationship field, it shows Select input with + button attached in the edit view. When we are to add a new relationship item by clicking + button, the expected behavior would be showing popup to create a new document.
But when the related collection is configured with autosave enabled, the popup quickly disappears and the page is navigated to the new document page of the related collection.

To Reproduce

Define a category collection with autosave enabled:

    ...
    versions: {
        drafts: {
            autosave: true,
        },
    },
    fields: [
        {
            name: 'title',
            label: 'Title',
            type: 'text',
            required: true,
        },
    ],
    ...

And define category field in pages collection

{
    name: 'category',
    label: 'Category',
    type: 'relationship',
    relationTo: 'category',
};

In Pages edit view, click + button in Category field.

Payload Version

2.19.3

Adapters and Plugins

No response

@tigersoft6084 tigersoft6084 added status: needs-triage Possible bug which hasn't been reproduced yet v2 labels Jun 21, 2024
JarrodMFlesch added a commit that referenced this issue Jul 23, 2024
Fixes #6887

Collections with autosave enabled would open and immediately close when
they were edited inside a relationship field. This PR threads onSave
through to autosave and checks the current drawer depth to determine if
it should call the onSave function or if it should redirect the user to
the doc page when autosave is triggered.
@github-actions github-actions bot removed the status: needs-triage Possible bug which hasn't been reproduced yet label Jul 23, 2024
@JarrodMFlesch
Copy link
Contributor

@tigersoft6084 the fix for this will be available in the next 2.x release.

Copy link

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants