Skip to content

Panel: unsaved changes UI pops up when opening structure field side panel #7491

@rasteiner

Description

@rasteiner

Description

When a structure field contains specific fields (link, color, probably others) which already contain a value, merely opening its side pane triggers the "unsaved changes" UI. Even when no changes were made.

The changes aren't actually persisted on the backend (no _changes folder), and refreshing the page makes the buttons go away.

Expected behavior
The "Discard" & "Save" buttons should only appear if the data has been changed.

Screenshots
From the demo online:

2025-08-06.09-43-53.mp4

To reproduce

  1. Go to https://getkirby.com/try and start a demo instance
  2. Log into the panel and navigate to a shop product
  3. Under "Available colors" click anything, but then make sure the color field in the side pane receives focus at some point
  4. close the side pane and notice the "Save" button

The link field in the same situation doesn't need focus, but it needs to point to a Page (not just any url).

Your setup

Kirby Version 5.0.3 (also 5.0.2, haven't tried other)

Console output

// BEFORE Save Button appears
> console.log(JSON.stringify(panel.content.version('latest').colors, null, 2))
< [
  {
    "color": "#005fa9",
    "name": "Blue"
  }
]

// AFTER Save Button appears
> console.log(JSON.stringify(panel.content.version('latest').colors, null, 2))
< [
  {
    "color": "#005fa9",
    "name": "Blue"
  }
]

> console.log(JSON.stringify(panel.content.diff(), null, 2))
< {
  "colors": [
    {
      "_id": "7235159d-afa9-4953-97fa-32fa8ba35622",
      "color": "#005fa9",
      "name": "Blue"
    }
  ]
}

Your system (please complete the following information)

  • Device: Desktop PC
  • OS: Windows 11
  • Browser: Chrome
  • Version: latest

Additional context
https://discord.com/channels/525634039965679616/525641819854471168/1402552743029243934

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions