#107551You currently have unsaved changes modal appears even if no changes
Description
When you create a text content element and close the window again, the modal window shows up:
You currently have unsaved changes which will be discarded if you close without saving.
That is not correct as I have not done any changes! This modal should only show up if I have changed any form values.
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Fix this issue
Start the commit message of your patch with this. Add what the patch does, and the versions it goes to in "Releases:". How to create a patch
- Commit message
-
[BUGFIX] You currently have unsaved changes modal appears even if no changes Resolves: #107551 Releases: main
Related issues 1
Files 1
History 19
-
Simon Schaufelberger changed subject
You currently have unsaved changes modal appear even if no changesYou currently have unsaved changes modal appears even if no changes <span data-processor="relativetime" data-value="2025-09-26T23:37:04+00:00" > 09/26/25, 23:37 </span> -
Oliver Bartsch commented and changed status
NewNeeds Feedback <span data-processor="relativetime" data-value="2025-09-30T09:43:37+00:00" > 09/30/25, 09:43 </span> -
Simon Schaufelberger changed attached simplescreenrecorder-2025-09-30_11.52.45.mp4 <span data-processor="relativetime" data-value="2025-09-30T09:55:46+00:00" > 09/30/25, 09:55 </span>
-
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2025-09-30T09:56:45+00:00" > 09/30/25, 09:56 </span>
@obartsch I have uploaded a video that shows my case under firefox and latest main as of today. The same applies for me for a clean TYPO3 13 installation.
-
Oliver Bartsch commented <span data-processor="relativetime" data-value="2025-09-30T14:29:08+00:00" > 09/30/25, 14:29 </span>
Hi Simon,
actually this is the expected behaviour. It needs to be ensured that an editor understands that after creating new element, this action is discarded on “close”. After the new record is stored. No confirmation dialog is displayed on just leaving the element.
If you like you can forward this to #cig-ux but from my point of view, this should not be changed.
Best,
Oli -
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2025-09-30T14:36:55+00:00" > 09/30/25, 14:36 </span>
Well, the thing is that actually the new content element isn’t created yet, it’s just an empty form and no changes have been made so I find it very confusing that I need to confirm that I didn’t do anything. If I would have changed a form element, THEN I would expect the modal but not when nothing has been changed.
> You currently have unsaved changes. Are you sure you want to discard these changes?
There are NO unsaved changes and in this case I don’t want to save anything because there is no change to be saved. It would just be an empty content element.
Why do you expect this behavior?
-
Simon Schaufelberger changed description TYPO3 Version
1312 <span data-processor="relativetime" data-value="2025-09-30T14:43:08+00:00" > 09/30/25, 14:43 </span> -
Rachel Foucard commented and changed Tags ux-approved <span data-processor="relativetime" data-value="2025-09-30T15:42:06+00:00" > 09/30/25, 15:42 </span>
Hi,
“UX people” feedback on this, Simon is right:- that kind of modal should appear only when there is a real risk of losing user-entered data. False positive alerts cause users to click mechanically, undermine trust, and slow down the flow.
- Inconsistent “unsaved changes” modal behaviour on create vs edit.
- Edit existing: close without changes → no modal (✅ expected)
- Create new: open and close without any input → modal shown (❌ not expected)
we should align behaviours.
-
Oliver Bartsch commented <span data-processor="relativetime" data-value="2025-09-30T16:12:53+00:00" > 09/30/25, 16:12 </span>
> There are NO unsaved changes […] It would just be an empty content element.
That’s not true. The user deliberately selected a specific record type. Additionally, defaults (TCAdefaults, defVals, etc.) are applied already.
That said, I respect any UX descision here. Just want to point out that especially for tt_content, this is not an empty form.
-
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2025-09-30T16:19:02+00:00" > 09/30/25, 16:19 </span>
Even if TCA defaults are applied that is still a default value and not a changed value by the user (no interaction with the form). Any changes are marked with a blue border/background usually but that is not the case here.
By the way, when you are in the Filelist module and create a new file with the link in the top menu and go back again, no modal is shown. Exactly like expected but when you actually enter a file name and go back again, no modal is shown. That is also not expected.
-
Georg Ringer changed Related to #87890 <span data-processor="relativetime" data-value="2026-10-07T18:37:02+00:00" > 10/07/26, 18:37 </span>
-
Georg Ringer commented <span data-processor="relativetime" data-value="2026-10-07T18:39:53+00:00" > 10/07/26, 18:39 </span>
I looked into this again and read up on the history, because the current behaviour has some background.
Why the dialog appears today
The dialog when closing a new record is intentional. In #87890 (2019) the exact opposite was reported as a bug: when creating a new content element and clicking “Close”, no dialog was shown. The form simply closed and nothing was saved, which confused editors. The fix back then marked new records as “changed” in general, so that the dialog appears.
In #104690 (2024) this marking was replaced for visual reasons (all fields were colored blue). To keep the dialog, a dedicated “is new record” check was added. The behaviour was deliberately meant to stay the same.
The actual trade-off
Both points of view are understandable:
- 2019: A new record was not saved and nobody told the editor. That felt like data loss.
- 2025 (this issue): Nothing was entered, yet the system asks for confirmation. That feels like a false alarm, is inconsistent with editing existing records, and teaches editors to click dialogs away.
A technical fix is small, but it would revert the decision made in #87890. So this should be a conscious decision of the UX team.
What I would suggest
- The dialog is dropped only for a plain close when the user has not changed anything.
- For preview, save and new and duplicate the confirmation should stay for unsaved new records. Otherwise a record with default values only would be created without asking.
@Rachel Foucard: Is this the way you would like to go from a UX point of view, also considering that closing without input then silently creates nothing (the case from #87890)? If so, I would work on a patch including a test.
@Oliver Bartsch: Would you be fine with this if the UX team confirms it?
-
Oliver Bartsch commented <span data-processor="relativetime" data-value="2026-10-07T20:28:03+00:00" > 10/07/26, 20:28 </span>
TBH I don’t see any difference to the suggestion from Simon a year ago. Anyways, I will keep my promise to accept whatever the UX team decides on this.
-
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2026-10-07T20:32:31+00:00" > 10/07/26, 20:32 </span>
Again: When there are changes (marked as blue) (new or not new), only then should the modal window appear. If there are no changes at all, i just just close without any additional confirmation.
-
Rachel Foucard commented <span data-processor="relativetime" data-value="2026-10-10T07:46:17+00:00" > 10/10/26, 07:46 </span>
ok, I suppose that there are two point of views here:
- one is: if I create a content, it is necessarely because I want to add something in it (text, configuration, images, etc.)
- the other one is: if I create a content, I don’t necessarely want to edit it right after the creation,
- example of dividers, containers, or content that does not need any editing action
- example: I prefer to first add several contents in my page to position them and after that, I will edit them
ect.
If we really want to address the risk that a user who wanted to add a “not edited” content may loose it by simply closing, it is just the text in the modal that should be changed.
So in total we have 4 cases with the create and edit forms:
- New content, edit content, close : modal saying: careful, modifications will be lost
- New content, nothing, close: modal saying: careful, the new content won’t be added in the page
- Existing content, edit content, close: modal saying: careful, modifications will be lost
- Existing content, nothing, close: no modal at all
NB: I only focused on the page content creation case, because the record creation in the list view is quite a different case: indeed, it would be weird to add new records wihout editing them in that kind of user interface.
-
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2026-10-10T13:05:48+00:00" > 10/10/26, 13:05 </span>
Rachel Foucard wrote in #note-15:
> New content, nothing, close: modal saying: careful, the new content won’t be added in the pageThis case is exactly what i mean. In this case I don’t want a modal.
A usecase is for example when I’m currently developing a new content element i don’t want to add anything, I just want to see if the fields are there, the flexform works and so on.
-
Wolfgang Klinger commented <span data-processor="relativetime" data-value="2026-10-11T05:03:32+00:00" > 10/11/26, 05:03 </span>
I wrote the patch for #87890 back then.
Editors picked a content type from the wizard, saw a form with all defaults set and clicked “Close”, because they thought the element already existed. It was gone, and nobody told them. That is why the dialog was added.
So I’d go with @rakel ‘s suggestion: keep the dialog for an untouched new record, but change the text. “You have unsaved changes” is simply wrong when nothing was typed. Something like “This new record has not been saved yet. If you close now, it will not be created.” says what really happens.
That keeps the protection from #87890 and fixes the false “unsaved changes” message @simonschaufi is bothered by. Dropping the dialog completely would bring the old problem back (and in two years we have the next ticket). Just my 2 cents.
-
Simon Schaufelberger commented <span data-processor="relativetime" data-value="2026-10-13T13:46:51+00:00" > 10/13/26, 13:46 </span>
Wolfgang Klinger wrote in #note-17:
> because they thought the element already existedthe question is: why would editors expect that if nothing is saved yet?
Here on forge I also see a form filled wit lots of data already filled but I also don’t expect that it is saved because I’m just replying here.
I still thing that the expected behavior is wrong because you can’t expect something to be saved when you just present a form to somebody filled with data. The only thing I would understand is that people don’t press save anymore because they expect that when I click on close that there will be a modal asking me to save but then the question is: what meaning has the “save” button then? Do people still use it if is kind of useless? I think that could still be a result from the old days with “save and close”.
I think the UX team should really think about the correct usage of these buttons up there.
-
Rachel Foucard commented <span data-processor="relativetime" data-value="2026-10-14T12:58:10+00:00" > 10/14/26, 12:58 </span>
Simon Schaufelberger wrote in #note-18:
> the question is: why would editors expect that if nothing is saved yet?I think this is a matter of different mental models: Some users expect that selecting a content element means it has already been created, while others understand that it only exists once they explicitly save it. And with the increasing use of autosave, persistent drafts, and automatic recovery in modern applications, I would argue that expecting content to be preserved without explicitly saving it is even becoming more common.
The point is not to determine which mental model is correct, or which one is shared by the majority of users. The point is that we cannot assume all users share the same mental model. And when different expectations can lead to unintended data loss, UX error-prevention principles suggest that we should make the consequences explicit before allowing that loss to happen.
That’s why I recommend keeping the confirmation dialog, while changing its message to explain what will actually happen.
Hi Simon, while we actually had such problems in e.g. the scheduler module, I can’t reproduce this for a “text element”.
Could you please somehow add a step to step guide how to reproduce this? Maybe a video would be quite helpful as well.
Additionally, please make sure this can be reproduced on a clean installation.
Thank you and all the best,
Oli