Skip to content

Multi-tenant plugin: "Leave without saving" prompt appears when navigating away from unmodified records #12826

Open
@TomSteer

Description

@TomSteer

Describe the Bug

I've come across an issue with the multi-tenant plugin where the "Leave without saving" message appears when navigating away from page records when nothing has changed.

Link to the code that reproduces this issue

https://github.com/payloadcms/payload/tree/main/examples/multi-tenant

Reproduction Steps

Steps to reproduce

  1. Log in as super-admin (using [email protected] credentials)
  2. Do not select any tenant in the tenant selector
  3. Open any page record
  4. Notice that the tenant selector automatically updates to match the tenant assigned to the page
  5. Try to navigate away from the page without making any changes
  6. A "Leave without saving" prompt appears even though no changes were made

Expected behavior

Since no changes were made to the record, navigating away should happen without any prompt.

Actual behavior

The system prompts with a "Leave without saving" message even though no changes were made to the record.

Additional information

  • This issue only occurs when initially loading the page without a tenant selected
  • If a tenant is selected before opening a page record, the issue does not occur

Which area(s) are affected? (Select all that apply)

plugin: multi-tenant

Environment Info

- payload: 3.41.0
- @payloadcms/plugin-multi-tenant: 3.41.0

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions