payloadcms / payload

The best way to build a modern backend + admin UI. No black magic, all TypeScript, and fully open-source, Payload is both an app framework and a headless CMS.
https://payloadcms.com
MIT License
21.04k stars 1.27k forks source link

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

Open tigersoft6084 opened 1 week ago

tigersoft6084 commented 1 week ago

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