Skip to content

[5.x]: Clicking "Save" in element slideouts doesn't save the element if the initial slideout auto-save hasn't triggered #15938

@mmikkel

Description

@mmikkel

What happened?

Description

If the "Save" button in an element slideout is clicked after making an initial content change, before the slideout auto-save has had a chance to trigger, the slideout will close and Craft will create a provisional draft behind the scenes, i.e. leaving the element in an "Edited" state, instead of actually saving it.

This behavior can make quick-editing elements via slideouts a chore, as authors needs to remember to wait for the auto-save to trigger after making their edit. If not, they will have to re-open the "Edited" element after the slideout closes, and then click "Save" again to actually save their changes.

I'm not able to reproduce this behavior when using the Cmd+S shortcut to save changes in slideouts, it specifically only happens when clicking the Save button.

CleanShot.2024-10-22.at.12.02.42.mp4

Steps to reproduce

  1. Edit an element in a slideout. Make sure the element has no "unsaved changes" from before.
  2. Make a change to a field, and then quickly click the slideout "Save" button, before the auto-save has had a chance to trigger.
  3. Observe that after the slideout closes, the element chip or card becomes tagged with "Edited", as Craft has created a provisional draft instead of actually saving the element.

Expected behavior

Clicking the "Save" button in an element slideout should always save the element.

Actual behavior

Clicking the "Save" button does not save the element if the slideout hasn't had time to create a provisional draft before the button is clicked.

Craft CMS version

5.4.8

PHP version

8.2.22

Operating system and version

macOS 14.6.1 (DDEV v1.23.4)

Database type and version

MySQL 8.0.36

Image driver and version

No response

Installed plugins and versions

None

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions